简单搞下rpm安装,抽时间搞下编译安装。
mysql下载地址
https://dev.mysql.com/downloads/file/?id=471231
查看解压包
[root@bigdata mysql5.5]# ls -lrt
total 294388
-rw-r--r--. 1 7155 31415 15139692 Jun 5 02:37 MySQL-client-5.5.57-1.el6.x86_64.rpm
-rw-r--r--. 1 7155 31415 4959208 Jun 5 02:37 MySQL-devel-5.5.57-1.el6.x86_64.rpm
-rw-r--r--. 1 7155 31415 51782792 Jun 5 02:37 MySQL-embedded-5.5.57-1.el6.x86_64.rpm
-rw-r--r--. 1 7155 31415 39982256 Jun 5 02:37 MySQL-server-5.5.57-1.el6.x86_64.rpm
-rw-r--r--. 1 7155 31415 1758696 Jun 5 02:37 MySQL-shared-5.5.57-1.el6.x86_64.rpm
-rw-r--r--. 1 7155 31415 3969748 Jun 5 02:37 MySQL-shared-compat-5.5.57-1.el6.x86_64.rpm
-rw-r--r--. 1 7155 31415 33120140 Jun 5 02:37 MySQL-test-5.5.57-1.el6.x86_64.rpm
-rw-r--r--. 1 root root 150722560 Jul 17 06:35 MySQL-5.5.57-1.el6.x86_64.rpm-bundle.tar ----压缩包
安装rpm包(有报错)
[root@bigdata mysql5.5]# rpm -ivh MySQL-shared-5.5.57-1.el6.x86_64.rpm
warning: MySQL-shared-5.5.57-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-shared ########################################### [100%]
[root@bigdata mysql5.5]# rpm -ivh MySQL-shared-compat-5.5.57-1.el6.x86_64.rpm
warning: MySQL-shared-compat-5.5.57-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-shared-compat ########################################### [100%]
[root@bigdata mysql5.5]# rpm -ivh MySQL-test-5.5.57-1.el6.x86_64.rpm
warning: MySQL-test-5.5.57-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
MySQL-client is needed by MySQL-test-5.5.57-1.el6.x86_64
[root@bigdata mysql5.5]# rpm -ivh MySQL-devel-5.5.57-1.el6.x86_64.rpm
warning: MySQL-devel-5.5.57-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-devel ########################################### [100%]
[root@bigdata mysql5.5]# rpm -ivh MySQL-embedded-5.5.57-1.el6.x86_64.rpm
warning: MySQL-embedded-5.5.57-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-embedded ########################################### [100%]
[root@bigdata mysql5.5]# rpm -ivh MySQL-client-5.5.57-1.el6.x86_64.rpm
warning: MySQL-client-5.5.57-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-client ########################################### [100%]
[root@bigdata mysql5.5]# rpm -ivh MySQL-test-5.5.57-1.el6.x86_64.rpm
warning: MySQL-test-5.5.57-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-test ########################################### [100%]
[root@bigdata mysql5.5]# rpm -ivh MySQL-server-5.5.57-1.el6.x86_64.rpm
warning: MySQL-server-5.5.57-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
file /usr/share/mysql/charsets/Index.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/armscii8.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/ascii.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/cp1250.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/cp1256.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/cp1257.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/cp850.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/cp852.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/cp866.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/dec8.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/geostd8.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/greek.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/hebrew.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/hp8.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/keybcs2.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/koi8r.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/koi8u.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/latin1.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/latin2.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/latin5.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/latin7.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/macce.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/macroman.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/charsets/swe7.xml from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/czech/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/danish/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/dutch/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/english/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/estonian/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/french/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/german/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/greek/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/hungarian/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/italian/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/japanese/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/korean/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/norwegian-ny/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/norwegian/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/polish/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/portuguese/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/romanian/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/russian/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/serbian/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/slovak/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/spanish/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/swedish/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/ukrainian/errmsg.sys from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
file /usr/share/mysql/errmsg-utf8.txt from install of MySQL-server-5.5.57-1.el6.x86_64 conflicts with file from package mysql-community-common-5.7.18-1.el7.x86_64
卸载安装server时的冲突包
[root@bigdata mysql5.5]# rpm -qa | grep mysql
mysql-community-common-5.7.18-1.el7.x86_64
[root@bigdata mysql5.5]# rpm -e --nodeps mysql-community-common-5.7.18-1.el7.x86_64
[root@bigdata mysql5.5]# rpm -qa | grep mysql
[root@bigdata mysql5.5]#
[root@bigdata mysql5.5]#
[root@bigdata mysql5.5]#
安装成功(注意安装目录)
[root@bigdata mysql5.5]# rpm -ivh MySQL-server-5.5.57-1.el6.x86_64.rpm
warning: MySQL-server-5.5.57-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
warning: user mysql does not exist - using root
warning: group mysql does not exist - using root
没有建mysql用户和组,默认使用了root
170717 7:00:37 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
170717 7:00:37 [Note] /usr/sbin/mysqld (mysqld 5.5.57) starting as process 17766 ...
170717 7:00:38 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
170717 7:00:38 [Note] /usr/sbin/mysqld (mysqld 5.5.57) starting as process 17773 ...
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h bigdata password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
Please report any problems at http://bugs.mysql.com/
[root@bigdata mysql5.5]#
启动mysql(mysql启动服务已经添加到系统服务中)
[root@bigdata mysql]# service mysql start
Starting MySQL.Logging to '/var/lib/mysql/bigdata.err'.
... SUCCESS!
[root@bigdata init.d]# pwd
/etc/init.d
[root@bigdata init.d]# ls -lrt mysql*
-rwxr-xr-x. 1 root root 10500 Jun 5 00:14 mysql
修改用户名密码
[root@bigdata init.d]# mysqladmin -u root password mysql
[root@bigdata init.d]#
[root@bigdata init.d]# mysql -u root -p mysql -----注意不能有空格
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
登录mysql
[root@bigdata init.d]# mysql -u root -pmysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.5.57 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> create database sqoop charset=utf8;
Query OK, 1 row affected (0.00 sec)
开放mysql的远程访问权限
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mysql' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES
-> ;
Query OK, 0 rows affected (0.00 sec)
mysql>