CentOS MySQL 配置

問題:mysql

MySQL安裝後root用戶沒法鏈接,提示 ERROR 1045 (28000): Access denied for user ’root’@’localhost’ (using password: NO)sql

解決:數據庫

# /etc/init.d/mysql 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 
# mysql -uroot -p 
Enter password: <輸入新設的密碼newpassword>服務器

 

問題:ui

操做MySQL數據庫時,提示 You must SET PASSWORD before executing this statementthis

解決:spa

mysql>  SET PASSWORD = PASSWORD('123456');rest

 

問題:ip

CentOS系統安裝好MySQL後,默認狀況下不支持用戶經過非本機鏈接上數據庫服務器。it

解決:

在mysql控制檯執行

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'MyPassword' WITH GRANT OPTION;mysql> FLUSH PRIVILEGES;

相關文章
相關標籤/搜索