Public
Snippet $630 authored by Jeremy

MYSQL - Installation MYSQL

Edited

DEBIAN :

$ apt install -y mysql-server mysql-client
$ mysql -u root -ppassword

Autoriser connexion distante :

$ nano /etc/mysql/my.cnf Changer bind-address avec l'adresse ip du serveur

$ service mysql restart
$ mysql -u root -ppassword
mysql> CREATE USER 'root'@'%' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
mysql> FLUSH PRIVILEGES;
mysql> exit;

CENTOS :

$ yum -y install mysql mysql-server
$ service mysqld start
$ /usr/bin/mysql_secure_installation
$ chkconfig mysqld on

Connexion distante :

$ mysql -u root -p
mysql> CREATE USER 'root'@'%' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
mysql> FLUSH PRIVILEGES;
mysql> exit;
$ service mysqld restart
$ iptables -I INPUT -p tcp --dport 3306 --syn -j ACCEPT
15 Bytes
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment