The following is the steps to setup mysql service on Linux server:
$ yum install mysql-server
To start the server
$ /etc/init.d/mysqld start
To set the login for Administrator:
$ mysqladmin -u root password ******
Login the MySQL:
$ mysql -u root -p
Enter the password: ******
$ mysql
# mysql> show databases;
You will see something like this:
+—————-+
| Database
+—————-+
| mysql
| test
+—————-+
2 rows in set (0.00 sec)
$ mysql > use mysql;
$ mysql > show tables;
$ mysql > select * from user;
$ mysql > CREATE USER {db_user} IDENTIFIED BY ‘userpass‘;
$ mysql > CREATE DATABASE {db_name};
$ mysql > GRANT ALL PRIVILEGES on {db_name}.* to ‘db_user‘@’localhost’ IDENTIFIED by ‘userpass‘;
$ mysql > select * from user;
$ mysql > SHOW GRANTS for ‘{db_user}‘@’localhost’;
$ mysql> quit
$ mysql> exit
Try manage the service:
$ service mysqld start
$ service mysqld stop
$ service mysqld restart














Entries (RSS)