How to install MySQL


How to install MySQL

Install MySQL

#yum install mysql-server mysql php-mysql

How to configure MySQL

Set the MySQL service to start on boot

#chkconfig --levels 235 mysqld on

Start the MySQL service

#service mysqld start

Log into MySQL

#mysql -u root

Set the root user password for all local domains
#SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new-password');
#SET PASSWORD FOR 'root'@'localhost.localdomain' = PASSWORD('new-password');
#SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('new-password');


Drop the Any user
#DROP USER ''@'localhost';
#DROP USER ''@'localhost.localdomain';

Exit MySQL
exit


Forgotten MySQL Root Password

Stop the mysql daemon
#mysqld_safe --skip-grant-tables
#mysql --user=root mysql
>update user set Password=PASSWORD('new-password') where user='root';
>flush privileges;
>exit;

No comments: