linux 下安装mysql-5.7.12-1.el6.x86_64.rpm-bundle.tar

时间:2022-06-28 02:53:21
-rw-rw-r--. 1 hadoop hadoop 457492480 Nov 27 18:33 mysql-5.7.12-1.el6.x86_64.rpm-bundle.tar


tar -xvf mysql-5.7.12-1.el6.x86_64.rpm-bundle.tar

-rw-r--r--. 1 hadoop hadoop 23672176 Mar 29 2016 mysql-community-client-5.7.12-1.el6.x86_64.rpm -rw-r--r--. 1 hadoop hadoop 334040 Mar 29 2016 mysql-community-common-5.7.12-1.el6.x86_64.rpm -rw-r--r--. 1 hadoop hadoop 3765324 Mar 29 2016 mysql-community-devel-5.7.12-1.el6.x86_64.rpm -rw-r--r--. 1 hadoop hadoop 38736700 Mar 29 2016 mysql-community-embedded-5.7.12-1.el6.x86_64.rpm -rw-r--r--. 1 hadoop hadoop 133956388 Mar 29 2016 mysql-community-embedded-devel-5.7.12-1.el6.x86_64.rpm -rw-r--r--. 1 hadoop hadoop 2174152 Mar 29 2016 mysql-community-libs-5.7.12-1.el6.x86_64.rpm -rw-r--r--. 1 hadoop hadoop 1720844 Mar 29 2016 mysql-community-libs-compat-5.7.12-1.el6.x86_64.rpm -rw-r--r--. 1 hadoop hadoop 149101172 Mar 29 2016 mysql-community-server-5.7.12-1.el6.x86_64.rpm -rw-r--r--. 1 hadoop hadoop 104017276 Mar 29 2016 mysql-community-test-5.7.12-1.el6.x86_64.rpm [hadoop@itcast01 xinwei]$ rpm -e mysql-libs-5.1.66-2.el6_3.x86_64 error: Failed dependencies: libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64 libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64 mysql-libs is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64 [hadoop@itcast01 xinwei]$ sudo rpm -e mysql-libs-5.1.66-2.el6_3.x86_64 [sudo] password for hadoop: error: Failed dependencies: libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64 libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64 mysql-libs is needed by (installed) postfix-2:2.6.6-2.2.el6_1.x86_64 [hadoop@itcast01 xinwei]$ sudo rpm -ivh --force mysql-community-common-5.7.12-1.el6.x86_64.rpm warning: mysql-community-common-5.7.12-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ########################################### [100%] 1:mysql-community-common ########################################### [100%] [hadoop@itcast01 xinwei]$ sudo rpm -ivh --force mysql-community-libs-5.7.12-1.el6.x86_64.rpm warning: mysql-community-libs-5.7.12-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ########################################### [100%] 1:mysql-community-libs ########################################### [100%] [hadoop@itcast01 xinwei]$ sudo rpm -ivh --force mysql-community-client-5.7.12-1.el6.x86_64.rpm warning: mysql-community-client-5.7.12-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ########################################### [100%] 1:mysql-community-client ########################################### [100%] [hadoop@itcast01 xinwei]$ sudo rpm -ivh --force mysql-community-server-5.7.12-1.el6.x86_64.rpm warning: mysql-community-server-5.7.12-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ########################################### [100%] 1:mysql-community-server ########################################### [100%] [hadoop@itcast01 xinwei]$ sudo service mysqld start Initializing MySQL database: [ OK ] Installing validate password plugin: [ OK ] Starting mysqld: [ OK ] [hadoop@itcast01 xinwei]$ sudo vi /var/log/mysqld.log [hadoop@itcast01 xinwei]$ mysql -uroot -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) [hadoop@itcast01 xinwei]$ mysql -uroot -p5GQ?S+O?a*7( -bash: syntax error near unexpected token `(' [hadoop@itcast01 xinwei]$ mysql -uroot -p'5GQ?S+O?a*7(' mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 5.7.12 Copyright (c) 2000, 2016, 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> show databases; ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. mysql> show database; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database' at line 1 mysql> show database; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database' at line 1 mysql> alter user 'root'@'localhost' identified by 'Mysql@123456'; Query OK, 0 rows affected (0.42 sec) mysql> flush privileges; Query OK, 0 rows affected (0.07 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | sys | +--------------------+ 4 rows in set (0.07 sec)
grant all privileges on *.* to root with grant option;
grant all privileges on * to 'root'@'localhost' identified by 'xxx!'
grant all privileges on * to 'root'@'%' identified by 'xxx!';
flush privileges;