Tutorial How to create new mysql user

Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Vanilla

Elite
Elite
Joined
Jan 28, 2019
Messages
839
Credits
1,190
First reset mysql password.
Code:
Expand Collapse Copy
/usr/local/etc/rc.d/mysql-server stop
Code:
Expand Collapse Copy
mysqld_safe --skip-grant-tables &
Code:
Expand Collapse Copy
mysql -u root
Code:
Expand Collapse Copy
use mysql;
Code:
Expand Collapse Copy
update user set password=PASSWORD("PAROLA_NOUA_PENTRU_USER_ROOT") where User='root';
Code:
Expand Collapse Copy
flush privileges;
Code:
Expand Collapse Copy
quit
Code:
Expand Collapse Copy
/usr/local/etc/rc.d/mysql-server restart
Now that we have changed the root user password we can create a new user. Also in putty we write the following
Code:
Expand Collapse Copy
mysql -u root -p
We will be prompted to enter a password, enter the password set in step 5 above.
Code:
Expand Collapse Copy
use mysql;
Code:
Expand Collapse Copy
CREATE USER 'USER_NOU'@'%' IDENTIFIED BY 'PAROLA_USER_NOU';
Code:
Expand Collapse Copy
GRANT ALL PRIVILEGES ON * . * TO 'USER_PUS_LA_PASUL_4'@'%';
Code:
Expand Collapse Copy
quit
And that was all, now you can log in to navicat.
 
Thanks, you should note this is only for FREEBSD. (Will not work on Ubuntu/Centos etc.)
Because some have webserver on ubuntu or centos not freebsd.
 
Back
Top