centos自帶MYSQL的初始化

# /etc/init.d/mysql stop  或者 service mysqld stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit

# /etc/init.d/mysql restart  或者 service mysqld start
# mysql -uroot -p
Enter password: <輸入新設的密碼newpassword>php

 

支持遠程訪問:http://blog.csdn.net/sun614345456/article/details/53672150mysql

mysql -uroot -p
use mysql;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
service mysqld restart
相關文章
相關標籤/搜索