I installed mysql community server on my macbook. A password for the user "root#localhost" was created. I have this saved. When I tried to create a connection in mysql admin I noticed that the "default" user was "loisgh". When I try to start the connection using the generated password I get an error that the password is incorrect.
Please advise on how I can create a password for user loisgh OR login as root. I don't see a place where I can enter a user ID.
You can use this command to connect mysql server:
mysql -uroot -p yourpwd
After successful connect to server , to delete the account "loisgh"
Related
MySQL newbie here,
I've installed MySQL on my Windows 10 machine and can connect using MySQL Workbench with the root username and everything works as promised.
However, now I want to create another user to connect with and give that user access to just one database on the server.
I've created the user with these commands:
CREATE USER 'user'#'localhost' IDENTIFIED BY 'f^rest_of_password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'user'#'localhost';
FLUSH PRIVILEGES;
I've created the database with this command:
CREATE DATABASE wordpress
SO, now I tried to create a connection in MySQL Workbench using that user and the password and it fails.
The error message says:
Cannot Connect to Database Server
Your connection attempt failed for user 'user' to the MySQL server at localhost:3306
Please:
1 Check that MySQL is running on address localhost
2 Check that MySQL is reachable on port 3306 (note: 3306 is the default, but this can be changed)
3 Check the user user has rights to connect to loclahost from your address (MySQL rights define what clients can connect to the server and from which machines)
4 Make sure you are both providing a password if needed and using the correct password for loclahost connecting from the host address you're connecting from
What is my next move?
Thanks,
Owen
As soon as I post a question....
Turns out I needed to specify the "Installation Type" of custom,
the "Configuration File Section" of mysqld
and the "Windows Service Name" of MySQL80
(Ended up copying the working root connection and changing the username and password).
I user mysql workbench and root account to connect to database. Connection is successful, but it has error :
"Table could not be fetched".
When i connect to server with ssh count and connect mysql also with root account => success. Then i show all tables is show ok. I also checked root account has all privileges.
Can you help me what's wrong ?
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
Even after uninstalling wamp and then reinstalling it's showing the same error.
You can try connecting via the command-line interface using the username and password you expect; if that doesn't work then I presume you'll need to reset your password.
The MySQL manual has detailed instructions for resetting a lost root password.
Generically, those instructions are:
Start MySQL with the --skip-grant-tables option
Connect via the command line client with mysql (or the Start Menu program that corresponds to the command line client).
Run FLUSH PRIVILEGES to load the privilege table
Reset the password with a command like SET PASSWORD FOR 'root'#'localhost' = PASSWORD('MyNewPass'); adjusting the username, host, and password as needed.
Stop and re-start the MySQL server.
I dropped accidentally all the users exist in my mysql DB and when I refresh the admin page I had this error :
Error
MySQL said:
1130 - Host 'localhost' is not allowed to connect to this MySQL server phpMyAdmin tried to connect to the MySQL server, and the
server rejected the connection. You should check the host, username
and password in your configuration and make sure that they correspond
to the information given by the administrator of the MySQL server.
How can I restore those users without losing my data ?
You just need to set an init file with the correct SQL to create/set a password for the root user, and then restart the server with the --init-file parameter.
Follow the directions here. Any SQL in the init file will be run, so you can create more users if you need to also.
I am facing problem in setting mysql replication monitoring using mk-heartbeat.
DBI connect('Heartbeat;host=10.160.251.223;mysql_read_default_group=client','heartbeat',...) failed: Access denied for user 'heartbeat'#'%' to database 'Heartbeat' at /EBSroot/maatkit/mk-heartbeat line 2056
I have created a user heartbeat that has no permissions.
Please refer this document http://www.maatkit.org/doc/mk-heartbeat.html
Also Access denied error is because of invalid credentials. Check MySQL username and password are correct on both server (Master and slave) and run application by referring to documentation provided.
I suggest you use mysql shell command to check if the username or password is ok
for example :
mysql -u heartbeat -p -h 10.160.251.223, and just enter if you don't have password...
by the way, I suggest adding a password for this user for security.