linux下安裝mysql的問題解決
今天試了下在Linux下安裝mysql,我只選了server和client兩個元件,沒有裝其他的元件.
安裝包的下載可以參見
server端的安裝:
[root@oel2 install_mysql]# rpm -ivh MySQL-server-advanced-5.6.14-1.rhel5.i386.rpm
Preparing... ########################################### [100%]
1:MySQL-server-advanced ########################################### [100%]
2013-12-08 21:49:03 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-12-08 21:49:03 17530 [Note] InnoDB: The InnoDB memory heap is disabled
2013-12-08 21:49:03 17530 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation
2013-12-08 21:49:03 17530 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-12-08 21:49:03 17530 [Note] InnoDB: Using Linux native AIO
2013-12-08 21:49:03 17530 [Note] InnoDB: Not using CPU crc32 instructions
2013-12-08 21:49:03 17530 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-12-08 21:49:03 17530 [Note] InnoDB: Completed initialization of buffer pool
2013-12-08 21:49:03 17530 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2013-12-08 21:49:03 17530 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2013-12-08 21:49:03 17530 [Note] InnoDB: Database physically writes the file full: wait...
2013-12-08 21:49:04 17530 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2013-12-08 21:49:06 17530 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2013-12-08 21:49:09 17530 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2013-12-08 21:49:09 17530 [Warning] InnoDB: New log files created, LSN=45781
2013-12-08 21:49:09 17530 [Note] InnoDB: Doublewrite buffer not found: creating new
2013-12-08 21:49:09 17530 [Note] InnoDB: Doublewrite buffer created
2013-12-08 21:49:09 17530 [Note] InnoDB: 128 rollback segment(s) are active.
2013-12-08 21:49:10 17530 [Warning] InnoDB: Creating foreign key constraint system tables.
2013-12-08 21:49:10 17530 [Note] InnoDB: Foreign key constraint system tables created
2013-12-08 21:49:10 17530 [Note] InnoDB: Creating tablespace and datafile system tables.
2013-12-08 21:49:10 17530 [Note] InnoDB: Tablespace and datafile system tables created.
2013-12-08 21:49:10 17530 [Note] InnoDB: Waiting for purge to start
2013-12-08 21:49:10 17530 [Note] InnoDB: 5.6.14 started; log sequence number 0
2013-12-08 21:49:10 17530 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2013-12-08 21:49:10 17530 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
A random root password has been set. You will find it in '/root/.mysql_secret'.
2013-12-08 21:49:12 17530 [Note] Binlog end
2013-12-08 21:49:12 17530 [Note] InnoDB: FTS optimize thread exiting.
2013-12-08 21:49:12 17530 [Note] InnoDB: Starting shutdown...
2013-12-08 21:49:13 17530 [Note] InnoDB: Shutdown completed; log sequence number 1625977
2013-12-08 21:49:13 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-12-08 21:49:13 17568 [Note] InnoDB: The InnoDB memory heap is disabled
2013-12-08 21:49:13 17568 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation
2013-12-08 21:49:13 17568 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-12-08 21:49:13 17568 [Note] InnoDB: Using Linux native AIO
2013-12-08 21:49:13 17568 [Note] InnoDB: Not using CPU crc32 instructions
2013-12-08 21:49:13 17568 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-12-08 21:49:13 17568 [Note] InnoDB: Completed initialization of buffer pool
2013-12-08 21:49:13 17568 [Note] InnoDB: Highest supported file format is Barracuda.
2013-12-08 21:49:13 17568 [Note] InnoDB: 128 rollback segment(s) are active.
2013-12-08 21:49:13 17568 [Note] InnoDB: Waiting for purge to start
2013-12-08 21:49:13 17568 [Note] InnoDB: 5.6.14 started; log sequence number 1625977
2013-12-08 21:49:13 17568 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2013-12-08 21:49:13 17568 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2013-12-08 21:49:13 17568 [Note] Binlog end
2013-12-08 21:49:13 17568 [Note] InnoDB: FTS optimize thread exiting.
2013-12-08 21:49:13 17568 [Note] InnoDB: Starting shutdown...
2013-12-08 21:49:15 17568 [Note] InnoDB: Shutdown completed; log sequence number 1625987
A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.
You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.
Also, the account for the anonymous user has been removed.
In addition, you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test database.
This is strongly recommended for production servers.
See the manual for more instructions.
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available on the web at
Support MySQL by buying support/licenses at
New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings
client端的安裝:
[root@oel2 install_mysql]# rpm -ivh MySQL-client-advanced-5.6.14-1.rhel5.i386.rpm
Preparing... ########################################### [100%]
1:MySQL-client-advanced ########################################### [100%]
[mysql@oel2 bin]$ yum list installed mysql\*
Loaded plugins: security
Installed Packages
MySQL-client-advanced.i386 5.6.14-1.rhel5 installed
MySQL-server-advanced.i386 5.6.14-1.rhel5 installed
[mysql@oel2 bin]$
啟動服務
[root@oel2 ~]# service mysql start
Starting MySQL.. [ OK ]
檢查mysql埠3306是否正常
[root@oel2 ~]# netstat -nat|grep 3306
tcp 0 0 :::3306 :::* LISTEN
[
連線的時候總是報錯。錯誤大概有如下幾種。
[root@oel2 ~]# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@oel2 ~]# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@oel2 ~]# mysqladmin -u root -p password '123456'
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
[root@oel2 ~]# /etc/init.d/mysql stop
Shutting down MySQL.. [ OK ]
[root@oel2 ~]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[1] 26352
131208 22:58:35 mysqld_safe Logging to '/var/lib/mysql/oel2.err'.
131208 22:58:35 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
[root@oel2 ~]# mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.14-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)
Copyright (c) 2000, 2013, 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 user set password=password('mysql') where user='root';
Query OK, 4 rows affected (0.08 sec)
Rows matched: 4 Changed: 4 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.05 sec)
mysql> quit
Bye
[root@oel2 ~]# /etc/init.d/mysql restart
Shutting down MySQL..131208 22:59:59 mysqld_safe mysqld from pid file /var/lib/mysql/oel2.pid ended
[ OK ]
Starting MySQL.. [ OK ]
[1]+ Done mysqld_safe --user=mysql --skip-grant-tables --skip-networking
[root@oel2 ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.14-enterprise-commercial-advanced
Copyright (c) 2000, 2013, 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>
mysql> show databases;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
mysql> SET PASSWORD = PASSWORD('mysql');
Query OK, 0 rows affected (0.00 sec)
mysql> create database test;
ERROR 1007 (HY000): Can't create database 'test'; database exists
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.01 sec)
安裝包的下載可以參見
server端的安裝:
[root@oel2 install_mysql]# rpm -ivh MySQL-server-advanced-5.6.14-1.rhel5.i386.rpm
Preparing... ########################################### [100%]
1:MySQL-server-advanced ########################################### [100%]
2013-12-08 21:49:03 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-12-08 21:49:03 17530 [Note] InnoDB: The InnoDB memory heap is disabled
2013-12-08 21:49:03 17530 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation
2013-12-08 21:49:03 17530 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-12-08 21:49:03 17530 [Note] InnoDB: Using Linux native AIO
2013-12-08 21:49:03 17530 [Note] InnoDB: Not using CPU crc32 instructions
2013-12-08 21:49:03 17530 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-12-08 21:49:03 17530 [Note] InnoDB: Completed initialization of buffer pool
2013-12-08 21:49:03 17530 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2013-12-08 21:49:03 17530 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2013-12-08 21:49:03 17530 [Note] InnoDB: Database physically writes the file full: wait...
2013-12-08 21:49:04 17530 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2013-12-08 21:49:06 17530 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2013-12-08 21:49:09 17530 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2013-12-08 21:49:09 17530 [Warning] InnoDB: New log files created, LSN=45781
2013-12-08 21:49:09 17530 [Note] InnoDB: Doublewrite buffer not found: creating new
2013-12-08 21:49:09 17530 [Note] InnoDB: Doublewrite buffer created
2013-12-08 21:49:09 17530 [Note] InnoDB: 128 rollback segment(s) are active.
2013-12-08 21:49:10 17530 [Warning] InnoDB: Creating foreign key constraint system tables.
2013-12-08 21:49:10 17530 [Note] InnoDB: Foreign key constraint system tables created
2013-12-08 21:49:10 17530 [Note] InnoDB: Creating tablespace and datafile system tables.
2013-12-08 21:49:10 17530 [Note] InnoDB: Tablespace and datafile system tables created.
2013-12-08 21:49:10 17530 [Note] InnoDB: Waiting for purge to start
2013-12-08 21:49:10 17530 [Note] InnoDB: 5.6.14 started; log sequence number 0
2013-12-08 21:49:10 17530 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2013-12-08 21:49:10 17530 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
A random root password has been set. You will find it in '/root/.mysql_secret'.
2013-12-08 21:49:12 17530 [Note] Binlog end
2013-12-08 21:49:12 17530 [Note] InnoDB: FTS optimize thread exiting.
2013-12-08 21:49:12 17530 [Note] InnoDB: Starting shutdown...
2013-12-08 21:49:13 17530 [Note] InnoDB: Shutdown completed; log sequence number 1625977
2013-12-08 21:49:13 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-12-08 21:49:13 17568 [Note] InnoDB: The InnoDB memory heap is disabled
2013-12-08 21:49:13 17568 [Note] InnoDB: Mutexes and rw_locks use InnoDB's own implementation
2013-12-08 21:49:13 17568 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-12-08 21:49:13 17568 [Note] InnoDB: Using Linux native AIO
2013-12-08 21:49:13 17568 [Note] InnoDB: Not using CPU crc32 instructions
2013-12-08 21:49:13 17568 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-12-08 21:49:13 17568 [Note] InnoDB: Completed initialization of buffer pool
2013-12-08 21:49:13 17568 [Note] InnoDB: Highest supported file format is Barracuda.
2013-12-08 21:49:13 17568 [Note] InnoDB: 128 rollback segment(s) are active.
2013-12-08 21:49:13 17568 [Note] InnoDB: Waiting for purge to start
2013-12-08 21:49:13 17568 [Note] InnoDB: 5.6.14 started; log sequence number 1625977
2013-12-08 21:49:13 17568 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2013-12-08 21:49:13 17568 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2013-12-08 21:49:13 17568 [Note] Binlog end
2013-12-08 21:49:13 17568 [Note] InnoDB: FTS optimize thread exiting.
2013-12-08 21:49:13 17568 [Note] InnoDB: Starting shutdown...
2013-12-08 21:49:15 17568 [Note] InnoDB: Shutdown completed; log sequence number 1625987
A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.
You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.
Also, the account for the anonymous user has been removed.
In addition, you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test database.
This is strongly recommended for production servers.
See the manual for more instructions.
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available on the web at
Support MySQL by buying support/licenses at
New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings
client端的安裝:
[root@oel2 install_mysql]# rpm -ivh MySQL-client-advanced-5.6.14-1.rhel5.i386.rpm
Preparing... ########################################### [100%]
1:MySQL-client-advanced ########################################### [100%]
[mysql@oel2 bin]$ yum list installed mysql\*
Loaded plugins: security
Installed Packages
MySQL-client-advanced.i386 5.6.14-1.rhel5 installed
MySQL-server-advanced.i386 5.6.14-1.rhel5 installed
[mysql@oel2 bin]$
啟動服務
[root@oel2 ~]# service mysql start
Starting MySQL.. [ OK ]
檢查mysql埠3306是否正常
[root@oel2 ~]# netstat -nat|grep 3306
tcp 0 0 :::3306 :::* LISTEN
[
連線的時候總是報錯。錯誤大概有如下幾種。
[root@oel2 ~]# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@oel2 ~]# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@oel2 ~]# mysqladmin -u root -p password '123456'
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
[root@oel2 ~]# /etc/init.d/mysql stop
Shutting down MySQL.. [ OK ]
[root@oel2 ~]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[1] 26352
131208 22:58:35 mysqld_safe Logging to '/var/lib/mysql/oel2.err'.
131208 22:58:35 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
[root@oel2 ~]# mysql -u root mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.14-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)
Copyright (c) 2000, 2013, 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 user set password=password('mysql') where user='root';
Query OK, 4 rows affected (0.08 sec)
Rows matched: 4 Changed: 4 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.05 sec)
mysql> quit
Bye
[root@oel2 ~]# /etc/init.d/mysql restart
Shutting down MySQL..131208 22:59:59 mysqld_safe mysqld from pid file /var/lib/mysql/oel2.pid ended
[ OK ]
Starting MySQL.. [ OK ]
[1]+ Done mysqld_safe --user=mysql --skip-grant-tables --skip-networking
[root@oel2 ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.14-enterprise-commercial-advanced
Copyright (c) 2000, 2013, 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>
mysql> show databases;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
mysql> SET PASSWORD = PASSWORD('mysql');
Query OK, 0 rows affected (0.00 sec)
mysql> create database test;
ERROR 1007 (HY000): Can't create database 'test'; database exists
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.01 sec)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23718752/viewspace-1062723/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Linux解決MySQL-python安裝失敗問題LinuxMySqlPython
- 【mysql】配置MySQL,解決安裝過程中的問題MySql
- Windows下ElasticSearch安裝中的問題解決WindowsElasticsearch
- Linux rpm安裝問題解決Linux
- 在linux中安裝mysql並解決中文亂碼問題LinuxMySql
- linux下安裝loudmouth庫中碰到的問題 & 解決方法薦Linux
- 解決ubuntu下安裝phpmyadmin訪問不了的問題UbuntuPHP
- centos7 下解決mysql-server找不到安裝包問題CentOSMySqlServer
- VMware下安裝Ubuntu遇到的問題及解決方案Ubuntu
- 解決 macOS 下 Python 3.8 安裝 mysqlclient 的問題MacPythonMySqlclient
- 安裝mysql資料庫及問題解決方法MySql資料庫
- redis 安裝及安裝遇到的問題解決Redis
- CodeMan的Linux問題解決集錦:Linux下解除安裝檔案的命令Linux
- CentOS6.5安裝mysql以及常見問題的解決CentOSMySql
- 安裝DBD:MySql模組遇到的問題及解決辦法MySql
- Linux下jdk1.5的安裝及中文顯示問題解決方案(轉)LinuxJDK
- Mysql安裝過程中遇到的問題及解決辦法MySql
- redis安裝及問題解決Redis
- IPython的安裝及問題解決Python
- 在Ubuntu上原始碼安裝MySQL+安裝問題解決+安全優化Ubuntu原始碼MySql優化
- 在CentOS上原始碼安裝MySQL+安裝問題解決+安全優化CentOS原始碼MySql優化
- LINUX下安裝oracle的java字型問題LinuxOracleJava
- linux 下 wu-ftp的安裝問題LinuxFTP
- 關於Linux下Texlive無法找到已安裝字型的問題與解決Linux
- MySQL 5.7 Window安裝手冊以及問題方案解決大全MySql
- Windows 安裝 MySQL 5.7.20 教程(及常見問題解決)WindowsMySql
- 徹底解決Linux下mongodb的安裝LinuxMongoDB
- 安裝mysql遇到的問題MySql
- Linux下安裝、解除安裝mysqlLinuxMySql
- mysql linux下安裝MySqlLinux
- Linux下Mysql安裝LinuxMySql
- linux 下安裝mysqlLinuxMySql
- linux下安裝MysqlLinuxMySql
- linux mint 19 pyenv 安裝 python 3.7.0 問題解決LinuxPython
- 在Linux上安裝Oracle時DISPLAY問題解決方案LinuxOracle
- pytorch安裝問題,使用soumith的conda源,下載安裝很慢的解決方法PyTorchMIT
- centos/linux下的安裝mysqlCentOSLinuxMySql
- mysql在linux下的安裝MySqlLinux