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 ?
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 need to give a remote user access to a MySQL database. I also need to limit the permissions they have to the MySQL database tables. The current database contains approx. 50+ tables so rather than revoke permissions table by table, I'm trying to give the user access with no privileges and then add those that are needed. What I've done appears to work when:
I'm logged in as root (via SSH)
I login using "mysql -u username -p" - enter my password for the newly created user.
This users account honors all the privileges I've set up. However, when this user tried to connect via their desktop client - they can connect but can not view the database. When using "use databasename" they get this error:
Error Code: 1044. Access denied for user 'username'#'%' to database 'database_name'
Not sure if this helps but I'm using Media Temple DV w/ Plesk. I've first added the user. Then I SSH in and revoked ALL privileges. Then I added the privileges for the user and did command "flush privileges". Nothing is working. As I said, if I'm accessing via the command line (after SSHing in as root) the permissions are honored and I can access the database - just not remotely.
Any help would be greatly appreciated.
May be network that is allowed to connect is localhost, but not users network IP.
And check max connections amount.
If you're logged in as root via SSH and MySQL database is on the same machine, then i guess that if you run:
mysql -u username -p
you try to connect to MySQL as 'username'#'localhost' user.
If you want to connect to MySQL database from outside of this server, you need to:
create user like 'username'#'%' which allow to connect to MySQL using 'username' from anywhere ('%')
allow mysql server to connect from outside by setting bind-address more details here
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"
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 running MySQL on an Amazon AWS Instance. I was able to previously connect to the MySQL Database via MySQL Query Browser. Now I am traveling outside the U.S. and I am having trouble connecting via the Query Browser. I am able to use Terminal to create an ssh connection and then login to MySQL, so it does not appear to be a larger issue with the MySQL Database.
Has anyone else had a similar problem? Any ideas how I can fix this?
This is the error I get from the MySQL Browser
Your connection attempt
failed for user 'admin' from your host to server at
ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com:3306: Can't connect to
MySQL server on 'ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com' (4)
Please: 1 Check that mysql is running on server
ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com
2 Check that mysql is
running on port 3306 (note: 3306 is the default, but this can be
changed)
3 Check the admin has rights to connect to
ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com 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
ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com connecting from the host
address you're connecting from
The only possible problem I see could be #4, but I ran and re-ran this command via Terminal:
grant all privileges on *.* to 'admin'#'%' identified by '<pass>' with grant option;