安装

官网mysql 下载地址

安装过程 省去

安装好之后 下载navicat

错误1

链接 遇到 mysql 2003 - Can't connect to MySQL server 错误,

解决方案

重启mysql 服务

#错误2ERROR 1045: Access denied for user: 'root@localhost' 处理方法。

##解决方案

以安全模式进入数据库         cd /usr/local/mysql/bin

            sudo su

              然后便可以看到终端命令变成这个开头: sh-3.2#               输入一下命令:

              sh-3.2# ./mysqld_safe --skip-grant-tables &

              之后便可以以安全模式进入数据库了。

另一个终端

Last login: Sat Dec 15 22:24:07 on ttys000xiaofengsedeMacBook-Pro:~ xiaofengse$ mysql -u -rootWelcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 7Server version: 8.0.13 MySQL Community Server - GPL

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select host,user,authentication_string from mysql.user;+-----------+------------------+------------------------------------------------------------------------+| host | user | authentication_string |+-----------+------------------+------------------------------------------------------------------------+| localhost | mysql.infoschema | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED || localhost | mysql.session | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED || localhost | mysql.sys | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED || localhost | root | $A$005$d_3&v_9%TNs692QhsNBvjzKDBaPxZKej3SO68XvGEcnKTeDMVWA | 8Ree*%+-----------+------------------+------------------------------------------------------------------------+4 rows in set (0.00 sec)

mysql> user mysql;ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'user mysql' at line 1mysql> update user set authentication_string='' where user='root';ERROR 1046 (3D000): No database selectedmysql> use mysql;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -A

Database changedmysql> update user set authentication_string='' where user='root';Query OK, 1 row affected (0.03 sec)Rows matched: 1 Changed: 1 Warnings: 0

mysql> ALTER user 'root'@'localhost' IDENTIFIED BY 'Root123#';ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statementmysql> ALTER user 'root'@'localhost' IDENTIFIED BY 'Root123#';ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statementmysql>mysql> flush privileges-> ;Query OK, 0 rows affected (0.00 sec)

mysql> ALTER user 'root'@'localhost' IDENTIFIED BY 'Root123#';Query OK, 0 rows affected (0.07 sec)

mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)

mysql> ALTER user 'root'@'localhost' IDENTIFIED BY 'root';Query OK, 0 rows affected (0.07 sec)

mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)

mysql>

12-16 03:22