1) Whether MySQL is installed in CHEKC CentOS
[Email protected] mysql]# Rpm-qa | grep mariadb
Mariadb-libs-5.5.52-1.el7.x86_64
2) uninstallation process
[Email protected] mysql]# rpm-e--nodeps mariadb-libs-5.5.52-1.el7.x86_64
3) installation process
The installation sequence is as follows:
RPM-IVH mysql-community-common-5.7.17-1.el7.x86_64.rpm
RPM-IVH mysql-community-libs-5.7.17-1.el7.x86_64.rpm
RPM-IVH mysql-community-client-5.7.17-1.el7.x86_64.rpm
RPM-IVH mysql-community-devel-5.7.17-1.el7.x86_64.rpm
RPM-IVH net-tools-2.0-0.17.20131004git.el7.x86_64.rpm
RPM-IVH mysql-community-server-5.7.17-1.el7.x86_64.rpm
4) Start MySQL
[Email protected] mysql]# systemctl start mysqld
View boot status
[[email protected] mysql]# ps-aux|grep-i MySQL
MySQL 2543 0.8 23.7 1119216 179968? Sl 20:44 0:00/usr/sbin/mysqld--daemonize--pid-file=/var/run/mysqld/mysqld.pid
Root 2586 0.0 0.1 112648 976 pts/0 s+ 20:45 0:00 grep--color=auto-i MySQL
Or
[Email protected] mysql]# Netstat-na|grep-i 3306
TCP6 0 0::: 3306:::* LISTEN
UNIX 2 [ACC] STREAM LISTENING 13306/var/run/dbus/system_bus_socket
5) Log in to MySQL using root
[Email protected] mysql]# mysql-uroot-p
Enter Password:
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:no)
[[email protected] sbin]# Whereis MySQL
MySQL:/usr/bin/mysql/usr/lib64/mysql/usr/include/mysql/usr/share/mysql/usr/share/man/man1/mysql.1.gz
You can view the installation directory for MySQL is/usr/bin
View Log
[email protected] sbin]# Cat/var/log/mysqld.log
2017-01-10t12:43:28.664990z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-01-10t12:43:32.450615z 0 [Warning] innodb:new log files created, lsn=45790
2017-01-10t12:43:35.748969z 0 [Warning] innodb:creating FOREIGN KEY constraint system tables.
2017-01-10t12:43:36.574416z 0 [Warning] No existing UUID have been found, so we assume that's the first time that thi s server has been started. Generating a new uuid:6779b126-d732-11e6-b856-0800275f50a5.
2017-01-10t12:43:36.677747z 0 [Warning] Gtid table is not a ready-to-be used. Table ' mysql.gtid_executed ' cannot be opened.
2017-01-10t12:43:36.678899z 1 [Note] A temporary password is generated for [email protected]: +X/GZM (hf9=f
2017-01-10t12:44:38.169331z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-01-10t12:44:38.172923z 0 [Note]/usr/sbin/mysqld (mysqld 5.7.17) starting as Process 2543 ...
2017-01-10t12:44:38.179188z 0 [Note] innodb:punch HOLE support available
2017-01-10t12:44:38.179226z 0 [Note] innodb:mutexes and rw_locks use GCC atomic builtins
2017-01-10t12:44:38.179231z 0 [Note] innodb:uses event mutexes
2017-01-10t12:44:38.179235z 0 [Note] innodb:gcc builtin __atomic_thread_fence () is used for memory barrier
2017-01-10t12:44:38.179239z 0 [Note] innodb:compressed tables use zlib 1.2.3
2017-01-10t12:44:38.179245z 0 [Note] innodb:using Linux native AIO
2017-01-10T12:44:38.179462Z 0 [Note] innodb:number of pools:1
2017-01-10t12:44:38.179555z 0 [Note] innodb:using CPU CRC32 Instructions
2017-01-10t12:44:38.181302z 0 [Note] innodb:initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-01-10t12:44:38.188077z 0 [Note] innodb:completed initialization of buffer pool
2017-01-10t12:44:38.191550z 0 [Note] innodb:if the mysqld execution user is authorized, page cleaner thread priority can Be changed. See the Mans page of SetPriority ().
2017-01-10t12:44:38.203389z 0 [Note] innodb:highest supported file format is Barracuda.
2017-01-10t12:44:38.287616z 0 [Note] innodb:creating shared tablespace for temporary tables
2017-01-10t12:44:38.287803z 0 [Note] innodb:setting file './ibtmp1 ' size to MB. Physically writing the file full; Please wait ...
2017-01-10t12:44:38.860560z 0 [Note] innodb:file './ibtmp1 ' size is now.
2017-01-10t12:44:38.865801z 0 [Note] innodb:96 redo rollback segment (s) found. Redo rollback Segment (s) is active.
2017-01-10t12:44:38.865872z 0 [Note] innodb:32 Non-redo rollback segment (s) is active.
2017-01-10t12:44:38.867349z 0 [Note] innodb:waiting for purge to start
2017-01-10t12:44:38.920092z 0 [Note] innodb:5.7.17 started; Log sequence Number 2536132
2017-01-10t12:44:38.920917z 0 [Note] Plugin ' federated ' is disabled.
2017-01-10t12:44:38.932784z 0 [Note] innodb:loading buffer pool (s) from/var/lib/mysql/ib_buffer_pool
2017-01-10t12:44:38.935813z 0 [Note] innodb:buffer pool (s) load completed at 170110 20:44:38
2017-01-10t12:44:39.061606z 0 [Note] Found Ca.pem, SERVER-CERT.PEM and Server-key.pem in Data directory. Trying to enable SSL support using them.
2017-01-10t12:44:39.062541z 0 [Warning] CA certificate Ca.pem is self signed.
2017-01-10t12:44:39.109111z 0 [Note] Server hostname (bind-address): ' * '; port:3306
2017-01-10t12:44:39.109573z 0 [Note] IPv6 is available.
2017-01-10t12:44:39.109605z 0 [Note]-':: ' resolves to ':: ';
2017-01-10t12:44:39.109643z 0 [Note] Server socket created on IP: ':: '.
2017-01-10t12:44:39.320841z 0 [Note] Event scheduler:loaded 0 Events
2017-01-10t12:44:39.321028z 0 [Note] executing ' SELECT * from INFORMATION_SCHEMA. TABLES; ' To get a list of TABLES using the deprecated partition engine. You could use the startup option '--disable-partition-engine-check ' to skip this check.
2017-01-10t12:44:39.321045z 0 [Note] Beginning of List of non-natively partitioned tables
2017-01-10t12:44:39.349166z 0 [Note] End of List of non-natively partitioned tables
2017-01-10t12:44:39.349489z 0 [Note]/usr/sbin/mysqld:ready for connections.
Version: ' 5.7.17 ' socket: '/var/lib/mysql/mysql.sock ' port:3306 mysql Community Server (GPL)
2017-01-10t12:47:14.947473z 3 [Note] Access denied for user ' root ' @ ' localhost ' (using Password:no)
6) MySQL Settings
Set Global validate_password_policy=0
Alter user ' root ' @ ' localhost ' identified by ' passw0rd ';
Create DATABASE hive;
Create user ' hive ' identified by ' passw0rd ';
Grant all privileges the hive.* to ' hive ' @ '% ';
How to install MySQL on CentOS