我在整个互联网上搜索并询问了几个工作人员如何解决这个问题,但我准备放弃......我在笔记本电脑上安装了 mySQL,但我无法以用户身份登录。
Raymunds-MacBook-Pro:~ raymundsinlao$ /usr/local/mysql/bin/mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2149
Server version: 5.6.13 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
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> -u root -p;
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 '-u root -p' at line 1
mysql>
当我尝试登录时,它告诉我语法错误。我尝试了很多不同的可能方法,但它不起作用。
我的另一个问题是我是匿名用户,所以我无法访问除 information_schema 和测试之外的任何数据库。
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
+--------------------+
2 rows in set (0.00 sec)
mysql> use mysql;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'
mysql>
在过去的 2 天里,我尝试了几十种不同的东西,并为此花费了 8 多个小时。请帮帮我!