建表,赋权,远程登陆
insert into mysql.user(Host,User,Password) values("localhost","tinytest",password("tinytest"));
flush privileges;
create database tinytest CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';
grant all privileges on tinytest.* to tinytest@localhost identified by 'tinytest';
flush privileges;
解决
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES).
$ mysql
+--------------------+
| Database |
+--------------------+
| information_schema |
+--------------------+
当进入mysql的时候看不到mysql数据库
解决方法,启动mysqld服务的时候带参数
$ mysqld --skip-grant-tables
$ mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('my_password') where USER='root';
mysql> FLUSH PRIVILEGES;