Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




Setting Mysql Root Password


Am having problems setting the root password for the mysql server on my computer. I'm using Mac OS X with apache, php 5 and mysql 4.1 installed. I've tried using the terminal utility but I've had an error message reading:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Setting MySql Root Password
I feel a bit daft as I can't seem to get passed p21 of Database Driven Website by Kevin Yank. But I'm learning

Ive got the latest copy and and want to follow it through to see what i can learn (lots I'm sure)

Im on a mac osx and am trying to set the root password. He says to do this using terminal in the bin directory of my MySql installation.

Where is it? i know basics about getting round terminal i.e changing directories and stuff.

Setting Root Password For MySQL
I'm Using the "Build Your Own Database Driven Website Using PHP and MYSQL" by Kevin Yank. On pg. 22 where the arguments new password are in parentheses, I typed in new password instead of my own new password ( I know that was dumb!). Anyway, when I quit the Mysql and start over I get the error: cannot login to local host password not excepted. How do I restart so that I can create a root password for Mysql?

Setting Up Root Password For Mysqldatabase
I have Fedora Core 4 installed in my pc and I need to setup mediawiki.
In the process of setting up mysql database (to create root password),

I did as instructed, typed -

1. mysql_install_db
2. mysqld_safe

it replies - Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysqld/mysqld.pid
060323 15:22:34 mysqld ended

but when I try to type mysqlshow, it gives this error instead
mysqlshow: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

I could not setup the root password for mysql bcos of this error.

Setting Mysql Password
How do I set the mysql password? Are there separate password for every database I create?

Setting Up The MySQL Password
I can't seem to see the page whan I am trying to set up the 'Setting Up the MySQL Password'. I know this is right at the start but all I get when I type in the Web browser http://127.0.0.1/myadmin is the sourcecode and not the actual log in page...

I know it's something silly I have done or not done (I have installed the Apache / MySQL / PHP stuff over and over again, but it still does the same thing to me.

The Apache services is running fine. The WinMySQLadmin is on green so I know that's fine.
I think it's maybe an explorer thing? but I can't seem to get it.

MySQL Root Password
I am having some trouble setting up the mySQL root password. It's probably right under my nose, but I can't seem to find where to edit it.

Mysql Root Password Problem
i m new to learning mysql and php.i m following Kevin yank's build your database driven website and i am following well but i m stuck on one problem that is when i star mysql or connect it and give him my login and password of root.it give me error which says
MySQL

Change MySQL Root Password
My current user/pswd for my localhost is root/"" (no password). I'm following the directions in the mysql command line window (im on windows and installed mysql via wamp) and can't get to change the darn thing.

Mysql As A Service And Root Password (-w W)
I have a few qeustions for some linux/mysql pros in here.

Background: I've just built MySQL on Mandrake Linux 9.1 from source.
I can get the mysql service running my:
shell> /usr/local/mysql/bin/mysqld_safe --user=mysql &

but I don't know how to keep it running, or how to make it start at
every bootup. How do I do that?

Also, I've made an alias to mysql:
alias=/usr/local/mysql/bin/mysql

but it won't span sessions, I think I need to export it, but I'm not
sure how to.

Also, via mysqladmin I set the root password to "password" which I
don't want to keep :) how do I got about changeing it now?

Thanks so much for your help. I know I probably should have installed
via RPM, but I'm wanting to learn as much as I can about all of this.

Mysql As A Service And Root Password (-w W)
Background: I've just built MySQL on Mandrake Linux 9.1 from source.
I can get the mysql service running my:
shell> /usr/local/mysql/bin/mysqld_safe --user=mysql &

but I don't know how to keep it running, or how to make it start at
every bootup. How do I do that?

Also, I've made an alias to mysql:
alias=/usr/local/mysql/bin/mysql

but it won't span sessions, I think I need to export it, but I'm not
sure how to.

Also, via mysqladmin I set the root password to "password" which I
don't want to keep :) how do I got about changeing it now?

Thanks so much for your help. I know I probably should have installed
via RPM, but I'm wanting to learn as much as I can about all of this.

Resetting MySQL Root Password
How can we reset the forgotten root password?
Can we change PRIVILEGES of a mysql user other than by root

Changing Forgotten MySQL Root Password
I get an error like this when trying to fix the password with safe mode and mysqladmin:

ERROR 1044: Access denied for user: '@localhost' to database 'mysql'

Here is what I have done so far:

Command: mysqladmin -u root -p <oldpw> password <newpw>
Outcome: mysqladmin: unable to change password; error: 'Access denied for user: '@localhost' to database 'mysql''

I have performed everything in the MySQL Manual section A.4.1 How to Reset the Root Password.

Same outcome same error. I dont get it. What is going on.
I have researched this for about 6 hours now with no luck. Finally going to see what the "experts" have to say.

Added Large Password To MySQL Root
I added a long password to the mysql root@localhost account and now it will not allow me to log into the mysql database's, mysql controlpanel, it will not accept my password.

Restart MySQL Service After Root Password Change
I installed mySQL on a Win2k machine and tried to change the root password,
which didn't seem to work.

I changed it this way:

c:>mysql
mysql> use mysql
mysql> update user set password=PASSWORD('test') where user='root';
mysql> exit

and then tried to login this way:

c:>mysql -u root -p
password: test

which didn't work. Then, after many unsuccessful attempts, I restarted the
service and suddenly the password I had set worked. Then I realized that (at
least for the root password) I needed to restart the mySQL service everytime
I changed the root password, otherwise it would not become effective.

Is this by design??? Am I doing something wrong?

PHPDev: Setting Root Passwd
I recently downloaded and installed PHPDev423, which worked nicely almost straight away; I like using PHPMyAdmin for the time being while experimenting, and learning.

While no password was set for the root user, I didn't manage to connect to MySql from a command window, so I set a password for it through PHPMyAdmin.

This resulted in me getting locked out from PHPMyAdmin since no user called "root" with an empty password could be found anymore. Luckily, this time I could connect to MySql directly to clear the password again.

My question is: how can I modify the PHPMyAdmin settings to not only function with the root user with a password set, but preferably ask me for that password upon entering as well?

Setting Password
I am using MySQL 4.1 on Win XP.I forgot my root password and I am trying to reset it. I am using the SQLyog GUI to manipulate my DB.I have a guest password stored in SQLyog and can access all of my databases.But I can't use SQLyog to change the password b/c it uses the new password alogorithm which is hashed to 32 characters opposed to 16 in the old alogorithm.I was wondering a way to reset my root password.I only have minimal privileges on this account such as SELECT.

Just in case anyone missed it,I can't log into my MySQL command line client since I don't know my root password.I would normally use OLD_PASSWORD('password') from there.

Setting Password
i've created my database and now i want to access it through php so im using:

mysql_connect('localhost:3306', "username", "password") or die(mysql_error());

but i haven't yet set a password and don't know how to, so when i run the file it comes up with the error:
mysql_connect() [function.mysql-connect]: Access denied for user......

is this because i need to set a password and username,if so then how? or is it maybe another different problem?

Setting User Password
I am having a problem getting mysql to recognize my user password. Currently I am doing everything on 'localhost' [CASE]

My root password works; I have access and can create databases as root.

I used MySql Administrator to create a user 'bill' and gave that user a password (billpw) different from root and applied most of the global privileges including 'CREATE'.

I can open mysql with root and rootpw. As well, I can open mysql with user 'bill' and rootpw but NOT with billpw.

[bill@CASE ~]$ mysql -u bill -p
Enter password:
ERROR 1045 (28000): Access denied for user 'bill'@'localhost' (using password: YES)

Even when I open Mysql with bill rootpw, I get the following:

mysql> CREATE DATABASE menagerie;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'menagerie'

I can CREATE the DATABASE as root.

I have read Section 5.7, “The MySQL Access Privilege System” and nothing seems to apply -- but that could just be newbie ignorance.

Do I have some Linux permission problem related to MySql or have I done something wrong when creating my user ? How can I check for the error?

Setting Up Password Fails
Having a problem setting up a password for MySQL

The reported problem when attempting to set up a root password is;

C:mysqlin>mysqladmin version
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to MySQL server on 'localhost' (10061)'
Check that mysqld is running on localhost and that the port is 3306.
You can check this by doing 'telnet localhost 3306'

When checking this:

C:mysqlin>telnet localhost 3306
Connecting To localhost...Could not open connection to the host, on port
3306: C
onnect failed

Setting Password Fails
The reported problem when attempting to set up a root password is;

C:mysqlin>mysqladmin version
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to MySQL server on 'localhost' (10061)'
Check that mysqld is running on localhost and that the port is 3306.
You can check this by doing 'telnet localhost 3306'

When checking this:

C:mysqlin>telnet localhost 3306
Connecting To localhost...Could not open connection to the host, on port
3306: C
onnect failed.

Root Password
So the root password was set to something that is currently unknown, how can I go about resetting it?

I can see in the mysql database, ie the following path

C:/program files/mysql/data/mysql

in the file user.MYD that the user root appears to have password root but it does not seem to work. Any ideas? I don't have the disk to reinstall at the moment. Running version 4.0.21-nt

Old 'root' Password
I'm trying to install MySQL server 5.1 on Windows and I'm getting error # 2003. It seems that I have a previous installation (which I must have forgotten) which I uninstalled but the old root password is still in the data dir which was not removed in the uninstall and I require it to create a new one. How do I -

a) remove the old one or
b) discover the old password so I can reuse it ??

Password Except Root
I know that there is default user and password in MySql as root and admin, but i want to create my own user and password like xxxx as a user name and yyy as a password so please tell me the procedure to create the user.

Root Password
I installed mysql correctly I am assuming
navigated to mysqlin and ran mysqladmin

C:Program FilesMySQLin>mysqladmin -u root -p password
Enter password: ***********
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: YES)'

C:Program FilesMySQLin>mysqladmin -u root -p password
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'

I am unable to log on as root and change the password. It says leave the password blank by default. I still will not let me connect. Do I have to start mysql.exe and type the mysql admin -u root from there

Root Password
i am new to mysql.i have installed mysql software which is provided with Linux CD .i need to provide password to root.i updated the user table to give password to the root.after restarting the mysqld service , i couldnt enter into mysql .one error message is displaying

ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Root Password
All day i'm trying to reset the root password, our webserver was crashed this week, our controll panel software created a random password.

I tried both methods for resetting the password, with the init tekst file and with the command -u root --skip-grant-tables.

Everytime I get the same error within the command promt "Program too big to fit in memory"

I tried this on two windows xp machines and one one windows 2003 server.

My Root Password
I have given root a password in MySQL, but now phpMyAdmin says "access denied".
I've put the following line in config.sample.inc.php:

$cfg['Servers'][$i]['password'] = 'password_goes_here';

but it doesn't seem to make any difference.
How do I get phpMyAdmin to recognise my root password?

Root Password
How can I change root password for the mysql. Please provide me the exact steps.


Changed Root Password, Now I Can't Do Anything
I am following the MySQL by Michael Kofler and looking at securing root access as currently it has no password.

I've logged into the MySQL consol and changed password using :

mysqladmin -u root -h localhost password XXX

However, i now can't do anything in in mysql terminal it comes back "access denied for user 'root'@'localhost' (using password :NO)

Recovering Root Password
I am having MySQL 4.1 in Windows 2003 Server and I had forgotten my root password and I can not remember it.

Resetting Root Password
I have set up mysql 5.0 (or whatever the latest version is), but for some reason it has lost what i set my root password is and i am tearing my hair out tryin to get back into the database.

I have attempted the commands it tells you to do on the mysql official documentation and it jus comes back with an invalid command and I have also attempted to skip grant tables, which allows me to change the password but as soon as i start the service running again it jus goes back to way it was and doesn't let me in :(.

And also reinstalled it like a billion times to discover it keeps the old root setup.

Resetting The Root Password
Having a browse through Paul Dubois's book, MySQL (ISBN 0-7357-1212-3), I
came across a section in which he describes how to reset the root password:

1. Shutdown the server by issuing a KILL under Unix or stopping the system
service under Windows.

2. Restart the server with the --skip-grant-tables option which allows you
to connect with no password and all privileges.

3. Reset the root password.

Given that the person first has to have operating system root or
administrator access to shutdown the server, wouldn't this qualify as a
security hole in cases where the OS root doesn't own the database, for
example, on shared machines.

Root And Password Info
where MySQL saves the root and its password info? .. I need to automatically retrieve it from my app.. is it possible?

Reset Root Password Mac OSX 10.3
i can't find the .pid file described in the password reset instructions (or for that matter really understand the instructions)..

Root Password / Startup
I'm using mysql-server-3.23.58-4 on a Linux (Fedora 1) machine,
and I'm new to databases/MySQL.

After reading the security section of the manual from
http://dev.mysql.com, I added passwords for the 'root' accounts.

However, now the startup script (/etc/rc.d/init.d/mysqld) fails.

I tried adding:

[mysql.server]
password=xxx

into /etc/my.cnf

How do I set the password for the startup script ?

Reset Root Password Or?
I have inherited the job of updating our company's method of generating worksheets for employees. it uses .asp pages that pulls info from mysql to fill the pages. The problem is twofold, first i'm stupid on mysql and asp, but learning.

second nobody knows the password for the mysql service and to make matters worse the server is continually used and i will have to stop ther service for some time to update the database. i guess first i need to be able to get in to mysql so if anybody can let me know in plain english what to do to reset or find the password that would be great, i tried the instructions in the manual with no results.

of course it doesnt help with 60 people complaining that the server is down while i am trying to do it either. The mysql version is 4.0.21 if that matters. I installed mysqladmin and cant log in as root without password, i can log in as mysql without passowrd but not enough privelages.

How Do I Change The Root Password?
My MySQL program won't let me make new databases, and I suspect the reason is that I installed the thing using Terminal on Mac OSX, following various tutorials I found on the web. Not that the tuts were bad, but it's just I really had no idea what I was doing - just typing things in exactly as told and trying to guess when things weren't spelled out.

Anyway, at some point in the process, I was supposedly supposed to set the root password for MySQL, but it never came up. So i went looking for tutorials on how to set it (most said you had to set it directly after installation), and tried it, but the thing wouldn't let me set it. There was some kind of error that had to do with permissions, like I wasn't allowed.

Basically i think it wasn't letting me set the root password because I didn't know the root password. Which of course means I'm up the proverbial chocolate creek without a paddle. I tried to reinstall the thing, but the same issue came up. Wants the password that I never got the opportunity to set. I tried like five times, then just gave up and forgot about the whole thing and went to bed.

Can Not Change Root Password?
When I typed in:

mysqladmin -uroot password NEW-PASS where NEW-PASS is my password of choice

no errors

in order to verify the password for root
I typed in
mysql -uroot -p
I was prompted for a password. If ignored password and press enter, no problem
if enter the NEW-PASS
It gave me errors like this:

ERROR 1045: access denied for user: 'root@127.0.0.1' (using password:YES)

It seems that I am not able to change password for root.
Anybody know how to alter root password?

Reset The Root Password
we got mysql running for a while with different users and our root user was never really used but now we need it to set new permissions and tadam we can't find the password.
so how do we go aobut resetting this? we have full access to everything it runs on Windows 2k3 standard.

Change Root Password
I have MySQL installed on my MacBook Pro, which I'm using to construct web sites, though I'm still very new to it. I used a pre-made installer package, which regrettably I can't find at the moment.

Of late I wanted to get in some practice securing the thing, so my first order of business was to set a root password, since phpMyAdmin was warning me about that. Unfortunately my terminal window no longer recalls exactly what I did, but it resulted in the following error, though I thought I was following the instructions in the manual exactly for changing a password:

mycomputer:/usr/local/mysql-5.0.41-osx10.4-i686 william$ sudo mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

So then I followed the instructions here: http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html to reset the password. After restarting the server, I now get this:

mycomputer:~ william$ sudo mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) .

Reset Root Password (4.0.20)
I am running MySQL version 4.0.20 and I did the misstake to do a privileges settings change using MyPHPadmin.

So, now I want to reset the master root password and then be able to login to my myPHPadmin site and reset all user privileges, fast and easy.

I do the following to reset my root password:

"mysqld_safe --skip-grant-tables --user=root &"

Then I login as root with "mysql -u root"

Once inside MySQL I write: "UPDATE mysql.user SET Password=PASSWORD('my_chosen_passwd') WHERE User='root';

I finish up with "FLUSH PRIVILEGES;"

and then "/quit" to quit MySQL.


Then I try to re-login with: "mysql -u root -p"

I enter my password and get the following;
"ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)" .

Resetting The Root Password
Having a browse through Paul Dubois's book, MySQL (ISBN 0-7357-1212-3), I
came across a section in which he describes how to reset the root password:

1. Shutdown the server by issuing a KILL under Unix or stopping the system
service under Windows.

2. Restart the server with the --skip-grant-tables option which allows you
to connect with no password and all privileges.

3. Reset the root password.

Given that the person first has to have operating system root or
administrator access to shutdown the server, wouldn't this qualify as a
security hole in cases where the OS root doesn't own the database, for
example, on shared machines.

Resetting The Root Password On OS X
When I try to open MySQL, I get this error message:

Access denied for user 'root'@'localhost' (using password: YES)

According to the manual on this site, that means I have to re-set the root password. Is the procedure for doing this is OS X Terminal any different from the generic Unix one that the manual gives?

Retrieve Root Password
I have a dedicated server with 1&1 (really bad tech support) and they don't seem to want to give me the root user password. The server is running Fedora Core 2 - is there anyway I can retrieve the root password? I want to be able to set CRON jobs to do MySQL dumps for backups every now and then.

Forget Root Password
i've installed OCS Inventory NG for inventory and it has installed
Mysql ver:

mysql Ver 14.12 Distrib 5.0.18, for Win32

now i have to make a dump for save database but don't forget the root
password.

Cannot Connect With Root Password
I've set my root password (or at least I think I did!), but am unable to connect to localhost with it. Now when I try to connect using root and that password - i receive a 'command not found' error.I'm totally perplexed. This is a new installation and I 'thought' I followed the instructions - but apparently not.
Can I remove this installation (and how would I do that?) and try to install again?

Root Password Problem At First Hurdle
Try as I might I can not work out how to reset the root password in mysql. I have followed Kevin Yanks instructions in his book on DB design and have scoured the net to no avail.

Unfortunately I have forgotten the password, even worse I have only just started this mad foray into database implementation.

http://dev.mysql.com/doc/refman/5.0/...rmissions.html

Many of the solutions seem to be for unix systems, I'm just running everything on my local machine on windows. The solution above seemed straightforward running from a commnad line, but I was getting 'invalid path' error messages in spades. How do you type those instructions at the command line?

Some solutions talk about 'grant tables' etc. I'm not far enough into the book to understand this yet.

Resetting Root Password Doesn't Work...
I was attempting to change my root password using the following 3 means from the manual (I'd temporarily forgotten it), but was unable to. Would really appreciate it if someone could point me to why the following problems... (I recalled the password later, but
would still be interested to know what's wrong below).

If I use skip-grant-tables while starting up the server, I am not able to see any tables in the mysql database (though they are there and I can see them if I bring the server up normally and use the root password which I actually know). Code:

Can I Set Database User Password When No Root Pw Is Set
I have installed PHPBB MediaWiki and SugarCRM on Ubuntu Server LAMP. I initially tried to set the root password on install and then could not log back in. After reinstall this is what I did for a new non root user.

root@invest:~# mysql -V
mysql Ver 14.12 Distrib 5.0.38, for pc-linux-gnu (i486) using readline 5.2

grant CREATE,INSERT,DELETE,UPDATE,SELECT on pauldb.* to paul@localhost;

set password for paul = password('mysecretpassword');

flush privileges;
exit;

Then when i go to login with this user I can't.

I have not set a password for root because the same thing happened when I tried to set root pw immediately after install of the database. This time I am trying to work out the access issue with a new user i have created. This way I still have access since and I won't have to reinstall the db.


Copyright 2005-08 www.BigResource.com, All rights reserved