May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

CENTOS 7 MySQL 5.7

CENTOS 7 MySQL 5.7

 

wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm

yum install -y mysql-community-server

 

systemctl start mysqld.service

[root@clusterserver1 software]# systemctl start mysqld.service
[root@clusterserver1 software]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.19 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql>update mysql.user set authentication_string=password(“test123″) where user=”root” and Host=”localhost”;
mysql>flush privileges;
mysql>quit;

systemctl restart mysqld;

 

vi /etc/my.cnf

 

[mysqld]

skip-grant-tables

skip-networking

 

[root@clusterserver1 software]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.19 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ IDENTIFIED BY ‘test123’ WITH GRANT OPTION;
mysql> select host, user from user;
+—————————+——+
| host | user |
+—————————+——+
| 127.0.0.1 | root |
| ::1 | root |
| clusterserver1.rmohan.com | |
| clusterserver1.rmohan.com | root |
| localhost | |
| localhost | root |
+—————————+——+
6 rows in set (0.00 sec)

 

vi /etc/sysconfig/iptables

-A INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT

 

vi /etc/my.cnf

 

[mysqld]

character-set-server=utf8

collation-server=utf8_general_ci

 

mysql> status;
————–
mysql Ver 14.14 Distrib 5.7.19, for Linux (x86_64) using EditLine wrapper

Connection id: 5
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ”
Using delimiter: ;
Server version: 5.7.19 MySQL Community Server (GPL)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/lib/mysql/mysql.sock
Uptime: 3 min 28 sec

Threads: 1 Questions: 44 Slow queries: 0 Opens: 56 Flush tables: 1 Open tables: 49 Queries per second avg: 0.211
————–

 

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>