简体   繁体   中英

Problems with mysql on linux and also importing a dump from windows

I'm a beginner with linux (linux mint distro) and I have been trying to install mysql server and workbench. I couldn't connect to mysql server without sudo command. I tried to connect to the server on workbench, and Access denied for user 'root'@'localhost' . So I try to run workbench with sudo from terminal. Nothing. So I followed what somebody posted here on stackoverflow about changing my password auth mode to mysql_native_password, and was able to access SQL Server from workbench (only using sudo command).

So I try to import a dump which I made on windows mysql-workbench, and it gives me two errors:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

and

ERROR 1115 (42000) at line 24: Unknown character set: 'utf8_general_ci'

Nevertheless, the database seems to have been correctly imported (I can see values and columns and tables and they look alright).

What's happening and how to stop getting these access denied errors? I tried to search the web and there are different answers, but none of them seem to address first install. I don't see why wouldn't it work if I have made a pretty default install:( Thanks a lot!

ps: I don't know if more specific info is needed. anonymous user was dropped after installation

Try resetting root password.

Step 1. Access to mysql using mysql -uroot

Step 2. Check the root user

select Host, User, authentication_string from mysql.user;

Step 3. Change password for root user

use mysql;
update user set authentication_string=password('NEWPASSWORD') where user='root';
flush privileges;
​quit;

Now try accessing to mysql using mysql -uroot -p using new password. If it works, use the credentials in workbench.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM