MYSQL server installation on Cent OS.


MYSQL server installation on Cent OS.

  1. Install mysql package on server.

yum -y install mysql mysql-server

  1. MySQL starts automatically whenever the system boots.

chkconfig –levels 35 mysqld on [apply]
chkconfig –list mysqld [check]

  1. start MySQL service

/etc/init.d/mysqld start

  1. Set passwords for the MySQL root account:

mysql_secure_installation

[Press Enter whenever asking & configure root password]

  1. Understand MySQL access
    mysql -u root -p —->ENTER MYSQL PASSWORD

mysql> SHOW VARIABLES LIKE “%version%”; —–> CHECK VERSION

mysql> SHOW DATABASES; ———–> CHECK DATABASE

mysql> CREATE DATABASE kesaridb; ————–>CREATE DATABASE

mysql> use kesaridb; ————-> USE DATABASE<NAME>

mysql> create table mysql_auth ( ———->CREATE TABLE UNDER DATABASE
-> username char(25) not null,
-> passwd char(32),
-> groups char(25),
-> primary key (username)
-> );

mysql> SHOW TABLES; ——-> CHECK TABLE CREATE OR NOT

mysql> GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘password$’ WITH GRANT OPTION; —-> GIVE PRIVALAGE FOR ROOT USER

mysql> SELECT user,host,password FROM mysql.user; ———> CHECK USER PASSWORD

  1. access mysql through Telnet (e.g. RemoteIP Address)
    telnet [IP Address& port number]

Thnaks…….

Leave a comment