I've just set up a LAMP server using SuSE Server 10. I want to set the root password for MySQL, so I entered the following in the terminal:
mysqladmin -u root password MyPassword
and the output is:
mysqladmin: Can't turn off logging; error: 'Access denied; you need SUPER
privilege for this operation'
I'm not really certain what SUPER privilege is for mysqladmin, and all my Google searches have been fruitless. I am able to use mysql from the command line without entering a password like this:
mysql -u root
But I can't access the mysql database to update the root password that way. Here is the output:
mysql> USE mysql;
mysql> ERROR 1044 (42000): Access denied for user ''#'localhost' to database 'mysql'
Any help would be greatly appreciated. Thanks.
I am still unsure what the solution to this problem is, but the solution I came up with was to install SuSE 11. Everything is working now. I think there was just a problem with my initial install.
Related
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.
I've searched a lot but nothing works for me.
I have a fresh installation of a LAMP server, installed via tasksel command.
My system runs php 7.4 and MySql 8
For some reason root user (that in my case is called phpmyadmin, by default) has no privileges on the DBs.
I can log in, so I'm sure the password is correct, but I cannot create a Database.
$ mysql -u phpmyadmin -p
mysql > create database test;
Access denied for user 'phpmyadmin'#'localhost' to database 'test'
EDIT
As suggested, here's the output of
mysql> SELECT name, Create_priv FROM mysql.user;
SELECT command denied to user 'phpmyadmin'#'localhost' for table 'user'
NEW EDIT
I tried to access without the password, following the guide reported here:
...
No results for me :(
Stop the MySQL Server: sudo /etc/init.d/mysql stop (OK)
Start the mysqld configuration: sudo mysqld --skip-grant-tables
output:
[2] 2345
[1] Exit 1 sudo mysqld --skip-grant-tables
Run: sudo service mysql start
output
[2]+ Exit 1 sudo mysqld --skip-grant-tables
It seems to exit with errors... Am I wrong?
I also tried to login in that situation, but I receive this message "ERROR 1698 (28000) Access denied for user 'root'#'localhost'"
If I try my phpmyadmin user, the message is "ERROR 1045 (28000): Access denied for user 'phpmyadmin'#'localhost' (using password: NO)"
EDIT 06/19/2020
I followed the steps reported here
How to reset or change the MySQL root password?
I had to use MD5() instead of PASSWORD() because it's now deprecated.
There's still something wrong.
Now I can access the database with no privileges and set/change my password.
Then I can flush all privileges.
Then I try...
mysql -u root -p
I enter my new password...
ERROR 1698 (28000): Access denied for user 'root'#'localhost'
I can still log in with the user set in phpMyAdmin, but there are still no privileges for me.
I also reinstalled MySql server.
I remember I had a similar problem last time I installed an old Linux Virtual Machine, but I solved that issue easily. Now I'm wondering what's wrong :(
SOLVED
I reinstalled my virtual machine and installed manually both php and mysql server.
To be sure to set privileges in the right way I followed this small guide... maybe helpful for someone.
https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-20-04
Bye!
So I'm setting up mysql for the first time.
I read somewhere that I have to run this
mysql -u root -p
To log in as root, in order to be able to create tables/databases using the mysql command line.
When I run this, I get prompted for a password - I hit enter (I thought the default password was blank).
I get this error
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: NO)
What's going on?
If you have a fresh installation of MySql you should be able to issue the following command and it should allow your connection.
xyz#ubuntu$ mysql -u root mysql
You then should set the root password and then create a user with the correct level of access.
look HERE for help connecting.
I must have tried every answer in stackoverflow for this problem, nothing works. Anyway:
I installed successfully mariadb 10 on centos 6.5, now I was trying to create database and all those things when I stumbled upon: Access denied for user ''#'localhost' to database 'mysql'. I seem to try logging in anonymously but I am really trying as root.
I logged in typing:
mysql -u root -p
Enter password: [none]
it entered and after I tried using mysql database:
MariaDB [(none)]> use mysql;
ERROR 1044 (42000): Access denied for user ''#'localhost' to database 'mysql'
I tried this locally by opening a tunnel in ssh as well
ssh -L 3306:localhost:3306 dev#machine.com
didn't work, also tried in bash...nothing works. Any other advice?
I'm working through tutorials in the book 'Cloning internet apps w/ Ruby.' I've made web apps before but they depended on sqlite and now I have to use mysql.
I've installed community server but when I try to create a database using the command line I'm receiving the error message listed above.
$ mysql
mysql> create database tinyclone;
Returns
ERROR 1044 (42000): Access denied for user ''#'localhost' to database 'p'
Notes:
The mysql command-line client flashes open and immediately closes, so I'm accessing it from the command prompt.
I've installed and uninstalled mysql several times in attempts to figure out this problem. In the latest install, I didn't set a password.
I'm aware that this line should probably be '$mysql -u <username> -p <password>' but I didn't set a password and I'm not sure what the username would be.
By default, the user is root
If you havn't set a password, use $ mysql -u root
The default MySQL username is 'root', try that without a password
The default username for MySQL is root, so you can try by
$ mysql -u root
by default it logs you with your Linux account. If you're logged as root on your Linux machine it will be OK just using $ mysql