Linux下允許MySQL 授權遠程連接


1、mysql -u root -p   (root)用戶名

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

3、mysql>flush privileges;

4、如果此時還無法連接,檢測配置文件(/etc/mysql/mysql.conf.d/mysqld.cnf) bind-address配置是否開啟,應該是關閉

#bind-address = 127.0.0.1 注釋掉;

 

# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1                    <----這個
#
# * Fine Tuning
#
key_buffer_size = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8

 

5、重啟mysql:/etc/init.d/mysql restart;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM