我正在關注this答案,以在Ubuntu 16.04上設置我的root密碼。 msql --version
給了我這樣的:mysql root用戶是否總是擁有默認的所有權限?
mysql Ver 15.1 Distrib 10.0.31-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
繼答案,當我輸入UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
我得到這個:
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
我發現,當我用同樣的密碼輸入相同的命令,它給了我這樣的:
Query OK, 0 row affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0
我認爲這是正確的。然後,我鍵入最後兩個命令,當我鍵入mysql -uroot -p
然後password
我仍然得到這樣的:
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
是否有極其新秀一步我逃課?或者任何命令輸出給你更多的數據?
UPDATE
當我鍵入sudo service mysql status
我得到這個:
Active: active (running) since Sáb 2017-11-11 00:44:57 BRST; 5s ago
Docs: man:systemd-sysv-generator(8)
Process: 4808 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)
Process: 5330 ExecStart=/etc/init.d/mysql start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/mysql.service
├─5358 /bin/bash /usr/bin/mysqld_safe
├─5502 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --skip-log-error --p
└─5503 logger -t mysqld -p daemon error
Nov 11 00:44:56 acer mysqld[5503]: 171111 0:44:56 [Note] InnoDB: 128 rollback segment(s) are active.
Nov 11 00:44:56 acer mysqld[5503]: 171111 0:44:56 [Note] InnoDB: Waiting for purge to start
Nov 11 00:44:56 acer mysqld[5503]: 171111 0:44:56 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.36-82.0 started; log sequence nu
Nov 11 00:44:56 acer mysqld[5503]: 171111 0:44:56 [Note] Plugin 'FEEDBACK' is disabled.
Nov 11 00:44:56 acer mysqld[5503]: 171111 0:44:56 [Note] Server socket created on IP: '127.0.0.1'.
Nov 11 00:44:56 acer mysqld[5503]: 171111 0:44:56 [Warning] 'user' entry '[email protected]' has both a password and an authentication plugin spe
Nov 11 00:44:56 acer mysqld[5503]: 171111 0:44:56 [Note] /usr/sbin/mysqld: ready for connections.
Nov 11 00:44:56 acer mysqld[5503]: Version: '10.0.31-MariaDB-0ubuntu0.16.04.2' socket: '/var/run/mysqld/mysqld.sock' port: 3306 Ubuntu 16.04
Nov 11 00:44:57 acer mysql[5330]: ...done.
Nov 11 00:44:57 acer systemd[1]: Started LSB: Start and stop the mysql database server daemon.
由於顯示here我看到我的日誌應該是正常的。那是對的嗎?
UPDATE
This answer爲我工作。但是尋找root權限,我結束了this question,它說「我的root用戶沒有所有權限」。這是一個立場?如果是的話,是不是root
用戶應該擁有所有這些特權?這是不是,爲什麼?這是一個安全問題嗎?
不要將Ubuntu的「root」與MySQL的「root」混淆。 –