Setup mySQL on Centos 7

Try to setup a new mysql , where I should suppose to  input MySQL new password but it asks for my password instead.  I have tried root password but no hope.

Any idea ?


Open in new window

mysqlInstall.txt
AXISHKAsked:
Who is Participating?
 
Tomas Helgi JohannssonConnect With a Mentor Commented:
Hi!

Using your local connection to MySQL (mysql command console) issue this command.

 GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'%' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;

Open in new window

or
GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'1.2.3.4' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;

Open in new window

where USERNAME is your username and 1.2.3.4 is your remote IP-address. Note that the first grant example puts a wildcard on the IP address so that you can connect to the database from any IP-address.
Then issue
 FLUSH PRIVILEGES;

Open in new window


To see the outcome of grants to your user isssue
SELECT * from information_schema.user_privileges where grantee like "'USERNAME'%";

Open in new window


Regards,
    Tomas Helgi
0
 
Manfred BertlManagerCommented:
Why are you doing it with 'sudo' when you are already logged in as root?
0
 
AXISHKAuthor Commented:
Already fixed the password issue. Local access seem fine.

However, I can access to the mysql through mysql workbench. Any idea ?/

Thx
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Manfred BertlManagerCommented:
If you can access through workbench, then everything is fine, right? =)
0
 
David FavorConnect With a Mentor Linux/LXD/WordPress/Hosting SavantCommented:
AXiSHK, I believe you meant to say you can't access mysql through Workbench.

If Workbench is running on a remote IP (non-localhost), then you'll have to create a GRANT for a user to access your MySQL instance.

https://webmasters.stackexchange.com/questions/68233/ubuntu-server-mysql-remote-access-from-mysql-workbench covers how to do this.
0
 
Prabhin MPEngineer-TechOPSCommented:
Hi
Seems like remote login  is not enabled in mysql for the particular database.
0
 
AXISHKAuthor Commented:
SQL WorkBench can't connect to the server IP with port 3306...  it seems that it only allow me for local access...

Try to telnet to the mysql server through port 3306, it can't connect. However, local access work prefect...
0
 
AXISHKAuthor Commented:
thx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.