Loading...
середу, 3 липня 2013 р.

Creating MySQL db and granting remote access


First of all use root login and password to run mysql:  mysql -u root -p
Create database: 
CREATE DATABASE dbname;
Set it as active:
USE dbname;
Create user for our database: 
CREATE USER 'test'@'localhost' IDENTIFIED BY 'password';
If we are going use this user from local machine (whrer database server is installed):
GRANT ALL PRIVILEGES ON database.* TO user@'localhost'; (optional:   IDENTIFIED BY 'password') 
If remote access from any IP is needed:
GRANT ALL PRIVILEGES ON database.* TO user@'%';  (optional:   IDENTIFIED BY 'password') 
One may use some particular IP instead of %



0 коментарі:

 
TOP