阿里雲服務器 suse liniux 下安裝mysql

痛苦領悟,在網上找了一堆發現都是轉來轉去的,自己裝了一下

國內mysql 鏡像下載 地址http://mirrors.sohu.com/mysql/

我選的是MySQL-client-5.6.26-1.linux_glibc2.5.x86_64.rpm 

和MySQL-server-5.6.25-1.linux_glibc2.5.x86_64.rpm

將這連個包上傳到suse linux 服務器

1 、先按裝server包

  rpm -ivh MySQL-server-5.6.25-1.linux_glibc2.5.x86_64.rpm 

-----------------------------------------------------------------------------------------

Preparing...                ########################################### [100%]
   1:MySQL-server           ########################################### [100%]

insserv: warning: script 'S01aliyun-rdate' missing LSB tags
insserv: warning: script 'K01agentwatch' missing LSB tags
insserv: warning: script 'aliyun-rdate' missing LSB tags
insserv: warning: script 'agentwatch' missing LSB tags
mysql                     0:off  1:off  2:on   3:on   4:on   5:on   6:off
2015-08-28 22:46:13 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-08-28 22:46:13 0 [Note] /usr/sbin/mysqld (mysqld 5.6.25) starting as process 15992 ...
2015-08-28 22:46:13 15992 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-08-28 22:46:13 15992 [Note] InnoDB: The InnoDB memory heap is disabled
2015-08-28 22:46:13 15992 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-08-28 22:46:13 15992 [Note] InnoDB: Memory barrier is not used
2015-08-28 22:46:13 15992 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-08-28 22:46:13 15992 [Note] InnoDB: Using Linux native AIO
2015-08-28 22:46:13 15992 [Note] InnoDB: Using CPU crc32 instructions
2015-08-28 22:46:13 15992 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-08-28 22:46:13 15992 [Note] InnoDB: Completed initialization of buffer pool
2015-08-28 22:46:13 15992 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2015-08-28 22:46:13 15992 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2015-08-28 22:46:13 15992 [Note] InnoDB: Database physically writes the file full: wait...
2015-08-28 22:46:13 15992 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2015-08-28 22:46:14 15992 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2015-08-28 22:46:15 15992 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2015-08-28 22:46:15 15992 [Warning] InnoDB: New log files created, LSN=45781
2015-08-28 22:46:15 15992 [Note] InnoDB: Doublewrite buffer not found: creating new
2015-08-28 22:46:15 15992 [Note] InnoDB: Doublewrite buffer created
2015-08-28 22:46:15 15992 [Note] InnoDB: 128 rollback segment(s) are active.
2015-08-28 22:46:15 15992 [Warning] InnoDB: Creating foreign key constraint system tables.
2015-08-28 22:46:15 15992 [Note] InnoDB: Foreign key constraint system tables created
2015-08-28 22:46:15 15992 [Note] InnoDB: Creating tablespace and datafile system tables.
2015-08-28 22:46:15 15992 [Note] InnoDB: Tablespace and datafile system tables created.
2015-08-28 22:46:15 15992 [Note] InnoDB: Waiting for purge to start
2015-08-28 22:46:15 15992 [Note] InnoDB: 5.6.25 started; log sequence number 0
A random root password has been set. You will find it in '/root/.mysql_secret'.
2015-08-28 22:46:16 15992 [Note] Binlog end
2015-08-28 22:46:16 15992 [Note] InnoDB: FTS optimize thread exiting.
2015-08-28 22:46:16 15992 [Note] InnoDB: Starting shutdown...
2015-08-28 22:46:17 15992 [Note] InnoDB: Shutdown completed; log sequence number 1625977




2015-08-28 22:46:17 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-08-28 22:46:17 0 [Note] /usr/sbin/mysqld (mysqld 5.6.25) starting as process 16014 ...
2015-08-28 22:46:17 16014 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-08-28 22:46:17 16014 [Note] InnoDB: The InnoDB memory heap is disabled
2015-08-28 22:46:17 16014 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-08-28 22:46:17 16014 [Note] InnoDB: Memory barrier is not used
2015-08-28 22:46:17 16014 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-08-28 22:46:17 16014 [Note] InnoDB: Using Linux native AIO
2015-08-28 22:46:17 16014 [Note] InnoDB: Using CPU crc32 instructions
2015-08-28 22:46:17 16014 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-08-28 22:46:17 16014 [Note] InnoDB: Completed initialization of buffer pool
2015-08-28 22:46:17 16014 [Note] InnoDB: Highest supported file format is Barracuda.
2015-08-28 22:46:17 16014 [Note] InnoDB: 128 rollback segment(s) are active.
2015-08-28 22:46:17 16014 [Note] InnoDB: Waiting for purge to start
2015-08-28 22:46:17 16014 [Note] InnoDB: 5.6.25 started; log sequence number 1625977
2015-08-28 22:46:17 16014 [Note] Binlog end
2015-08-28 22:46:17 16014 [Note] InnoDB: FTS optimize thread exiting.
2015-08-28 22:46:17 16014 [Note] InnoDB: Starting shutdown...
2015-08-28 22:46:19 16014 [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 at http://bugs.mysql.com/


The latest information about MySQL is available on the web at


  http://www.mysql.com


Support MySQL by buying support/licenses at http://shop.mysql.com


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

---------------------------------------------------------------------

出現以上表示server 安裝正常 

進入 cd /etc/init.d/目錄

接着執行 ./mysql start 啓動mysql服務

然後 命令  netstat -nat 查看下3306端口是否啓動

-------------------------------------------------------

Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      

---------------------------------------------------------------

正確啓動了安裝client

  輸入命令 : rpm -ivh MySQL-client-5.6.26-1.linux_glibc2.5.x86_64.rpm 

-------------------------------------------------------------------------

warning: MySQL-client-5.6.26-1.linux_glibc2.5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 5072e1f5
Preparing...                ########################################### [100%]
   1:MySQL-client           ########################################### [100%]

------------------------------------------------------------------------------

ok安裝完畢

接着登陸mysql

1、查看安裝時root用戶默認生成的祕密

命令: cd /root/

vim  .mysql_secret 

可以看到隨機生成的密碼02Khos4T8HkIU3_1

------------------------------------------

# The random password set for the root user at Fri Aug 28 22:46:15 2015 (local time): 02Khos4T8HkIU3_1

----------------------------------------------------------

2、登陸mysql

mysql -uroot -u 

pass: 02Khos4T8HkIU3_1

------------------------------------------------------------------

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.25


Copyright (c) 2000, 2015, 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> 

----------------------------------------------------------------------

進去後需要重新設置密碼纔可以進行數據庫的其他操作。




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章