Results 1 to 6 of 6
Hi,
I finish doing installation for MySQL 5.1 using rpm. So now, i want to login to mysql database but i dont know the password. Can anyone tell me how ...
- 02-14-2009 #1Just Joined!
- Join Date
- Jan 2007
- Posts
- 6
How to: MySQL
Hi,
I finish doing installation for MySQL 5.1 using rpm. So now, i want to login to mysql database but i dont know the password. Can anyone tell me how to reset the password? The default installation for MySQL is 4.1. Where the exact place or directory for MySQL 5.1? My server install with CentOS 4.1.
Thank you.
- 02-14-2009 #2
If you havent setup a root password before.
use this
or this if you want to change or update password# mysqladmin -u root password NEWPASSWORD
then login# mysqladmin -u root -p oldpassword newpass
# mysql -u root -p
- 02-14-2009 #3Linux Newbie
- Join Date
- Feb 2009
- Posts
- 99
kill all MySQL Server side process.
ps aux | grep mysql
use command "kill -9 PID" or " service mysqld stop"
then start mysql by hand "mysqld_safe --skip-granttable" <-- I am not sure this option spell correct, you can use mysqld_safe --help try to confirm .
when mysqld_safe --skip-granttable & <--- start you can use command "mysql" login to mysql db as administrator.
update mysql.user set password=password('123') where user='root';
flush privilege;
your password change finish.
- 02-14-2009 #4
I just installed MySQL on Fedora 10, and I couldn't access the server to set up the password. I finally had to use the "skip-grant-tables" option that signmem mentions. But instead of adding it as an option to the mysql command, I had to add it to the /etc/my.cnf file. It should look like this:
I was then able to set up the password and start the server. I then removed it from the file.Code:[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=1 skip-grant-tables
I found a very helpful online book for MySQL:
MySQL Essentials - TechotopiaPaul
Please do not send Private Messages to me with requests for help. I will not reply.
- 02-15-2009 #5Linux Newbie
- Join Date
- Feb 2009
- Posts
- 99
never add
old_passwords=1
skip-grant-tables
to my.cnf
it means never load grant-tables <-- it use to define use's permission!!!
after type flush privileges
restart mysqld server.
- 02-15-2009 #6Paul
Please do not send Private Messages to me with requests for help. I will not reply.


Reply With Quote
