This guide will walk you through the process of setting up a MySQL database with a new user using the command line.
- MySQL installed on your system.
-
Open your terminal or command prompt.
-
Log in to MySQL as the root user:
mysql -u root -p use mysql CREATE USER 'Put your new user name here'@'%' IDENTIFIED BY 'Put your new password here'; GRANT ALL PRIVILEGES ON *.* TO 'Put your new user name here'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES; exit
Output:
Note
You Need To Open The ports for the MySql which is 3306.
- This is to be done when you are not able to add the data in the panel.
- Make sure your MYSQL Ports are open.
- You need to go in this file
nano /etc/mysql/mariadb.conf.d/50-server.cnf
- Change the Bind port from
127.0.0.1
TO0.0.0.0
- Don't use the numpad of your keyboard in this file.
-
Save the file.
-
Run
systemctl restart mysql && systemctl restart mariadb
- So that all the settings take place