oDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
保存后,重启服务sudo service mysql restart.
2.无验证进入mysql数据库修改user表中root账号信息,flush privileges;
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> update mysql.user set authentication_string=password('账号密码') where user='root';
Query OK, 0 rows affected, 1 warning (0.03 sec)
Rows matched: 3 Changed: 0 Warnings: 1
mysql> update user set plugin="mysql_native_password";
Query OK, 1 row affected (0.00 sec)
Rows matched: 7 Changed: 1 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
3./etc/mysql/mysql.conf.d/mysqld.cnf文件,去掉skip-grant-tables,开启校验
4.重启服务
sudo service mysql restart;
至此就搞定了,使用jdbc、非Linux root账号都可以登录了。