Ubuntu MySQL配置管理員密碼
Ubuntu mysql是常用的開發(fā)系統(tǒng),于是我學(xué)習(xí)研究了設(shè)置root密碼進(jìn)入U(xiǎn)buntu mysql,在這里對(duì)大家詳細(xì)介紹下設(shè)置root密碼進(jìn)入U(xiǎn)buntu mysql系統(tǒng)應(yīng)用,希望對(duì)大家有用。
設(shè)置root密碼進(jìn)入mysql
root@zack-desktop:~# sudo mysql -u root -pEnter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 45
Server version: 5.1.37-1ubuntu5 (Ubuntu)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
配置 Ubuntu MySQL 的管理員密碼:
mysql> sudo mysqladmin -u root password newpassword或mysql> GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY "password01!";Query OK, 0 rows affected (0.00 sec)
修改配置文件允許遠(yuǎn)程訪問或控制
1新建一個(gè)測(cè)試用的數(shù)據(jù)庫
mysql> create database test;
Query OK, 1 row affected (0.00 sec)
2 給數(shù)據(jù)庫添加test_root管理員用戶
mysql> GRANT ALL PRIVILEGES ON test.* TO test_root@"%" IDENTIFIED BY "123456";
Query OK, 0 rows affected (0.14 sec)
3打開配制文件
$sudo gedit /etc/mysql/my.cnf
my.conf
老的版本中 >skip-networking => # skip-networking 新的版本中 >bind-address=127.0.0.1 => bind-address= 你機(jī)器的IP
【編輯推薦】