ubuntu apt-get 安裝mysql

安裝

apt-get install mysql-server

設置root密碼

mysql -uroot -p

>use mysql;

>update user set authentication_string='111111', password_expired='N', plugin='mysql_native_password' from user

>where user='root' and host='localhost';

>quit;

設置遠程訪問

vi /etc/mysql/mysql.conf.d/mysqld.cnf 

註釋掉bind-address = 127.0.0.1

進入mysql,執行授權命令

grant all on *.* to root@'%' identified by '111111' with grant option;

flush privileges;

重啓服務

service mysql restart

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章