SUSE11 安裝mysql


SUSE11 

檢測系統是否安裝MySQL

#rpm -qa | grep -i mysql
若已安裝過,會出現:
MySQL-server-5.0.22-0.i386
MySQL-client-5.0.22-0.i386
那么輸入以下命令刪除它:
#rpm -ev MySQL-server-5.0.22-0.i386
# rpm -ev MySQL-client-5.0.22-0.i386
注意:若刪除的時候,出現刪除不成功,出現依賴的包,前提必須刪除依賴項。rpm -ev dovecot-1.0.7-7.el5.x86_64

在suse11.2-64上先安裝一個本地庫: 用國內鏡像,注意mysql 5.6.22 由於版本更新,所以可以直接訪問http://mirrors.sohu.com/mysql/MySQL-5.6/ 查看新的版本,否則wget 下載不到需要的rpm文件.

     wget -c  http://mirrors.sohu.com/mysql/MySQL-5.6/MySQL-server-5.6.22-1.sles11.x86_64.rpm     (for suse11-64版本)

     wget -c  http://mirrors.sohu.com/mysql/MySQL-5.6/MySQL-client-5.6.22-1.sles11.x86_64.rpm

     wget -c  http://mirrors.sohu.com/mysql/MySQL-5.6/MySQL-devel-5.6.22-1.sles11.x86_64.rpm            

下載完成后開始安裝:

    rpm -ivh MySQL-server-5.6.22-1.sles11.x86_64.rpm MySQL-client-5.6.22-1.sles11.x86_64.rpm MySQL-devel-5.6.22-1.sles11.x86_64.rpm

Preparing... ########################################### [100%] 

1:MySQL-client ########################################### [ 50%] 
2:MySQL-server ########################################### [100%] 
warning: user mysql does not exist - using root 
warning: group mysql does not exist - using root 
insserv: Service network is missed in the runlevels 4 to use service mysql 
mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off 
2014-12-22 16:36:57 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 
2014-12-22 16:36:57 20644 [Note] InnoDB: Using atomics to ref count buffer pool pages 
2014-12-22 16:36:57 20644 [Note] InnoDB: The InnoDB memory heap is disabled 
2014-12-22 16:36:57 20644 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 
2014-12-22 16:36:57 20644 [Note] InnoDB: Memory barrier is not used 
2014-12-22 16:36:57 20644 [Note] InnoDB: Compressed tables use zlib 1.2.3 
2014-12-22 16:36:57 20644 [Note] InnoDB: Using Linux native AIO 
2014-12-22 16:36:57 20644 [Note] InnoDB: Using CPU crc32 instructions 
2014-12-22 16:36:57 20644 [Note] InnoDB: Initializing buffer pool, size = 128.0M 
2014-12-22 16:36:57 20644 [Note] InnoDB: Completed initialization of buffer pool 
2014-12-22 16:36:57 20644 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created! 
2014-12-22 16:36:57 20644 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB 
2014-12-22 16:36:57 20644 [Note] InnoDB: Database physically writes the file full: wait... 
2014-12-22 16:36:57 20644 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB 
2014-12-22 16:36:57 20644 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB 
2014-12-22 16:36:58 20644 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0 
2014-12-22 16:36:58 20644 [Warning] InnoDB: New log files created, LSN=45781 
2014-12-22 16:36:58 20644 [Note] InnoDB: Doublewrite buffer not found: creating new 
2014-12-22 16:36:58 20644 [Note] InnoDB: Doublewrite buffer created 
2014-12-22 16:36:58 20644 [Note] InnoDB: 128 rollback segment(s) are active. 
2014-12-22 16:36:58 20644 [Warning] InnoDB: Creating foreign key constraint system tables. 
2014-12-22 16:36:58 20644 [Note] InnoDB: Foreign key constraint system tables created 
2014-12-22 16:36:58 20644 [Note] InnoDB: Creating tablespace and datafile system tables. 
2014-12-22 16:36:58 20644 [Note] InnoDB: Tablespace and datafile system tables created. 
2014-12-22 16:36:58 20644 [Note] InnoDB: Waiting for purge t start 
2014-12-22 16:36:58 20644 [Note] InnoDB: 5.6.22 started; log sequence number 0 
A random root password has been set. You will find it in '/root/.mysql_secret'. 
2014-12-22 16:36:58 20644 [Note] Binlog end 
2014-12-22 16:36:58 20644 [Note] InnoDB: FTS optimize thread exiting. 
2014-12-22 16:36:58 20644 [Note] InnoDB: Starting shutdown... 
2014-12-22 16:37:00 20644 [Note] InnoDB: Shutdown completed; log sequence number 1625977 


2014-12-22 16:37:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 
2014-12-22 16:37:00 20666 [Note] InnoDB: Using atomics to ref count buffer pool pages 
2014-12-22 16:37:00 20666 [Note] InnoDB: The InnoDB memory heap is disabled 
2014-12-22 16:37:00 20666 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 
2014-12-22 16:37:00 20666 [Note] InnoDB: Memory barrier is not used 
2014-12-22 16:37:00 20666 [Note] InnoDB: Compressed tables use zlib 1.2.3 
2014-12-22 16:37:00 20666 [Note] InnoDB: Using Linux native AIO 
2014-12-22 16:37:00 20666 [Note] InnoDB: Using CPU crc32 instructions 
2014-12-22 16:37:00 20666 [Note] InnoDB: Initializing buffer pool, size = 128.0M 
2014-12-22 16:37:00 20666 [Note] InnoDB: Completed initialization of buffer pool 
2014-12-22 16:37:00 20666 [Note] InnoDB: Highest supported file format is Barracuda. 
2014-12-22 16:37:00 20666 [Note] InnoDB: 128 rollback segment(s) are active. 
2014-12-22 16:37:00 20666 [Note] InnoDB: Waiting for purge to start 
2014-12-22 16:37:00 20666 [Note] InnoDB: 5.6.22 started; log sequence number 1625977 
2014-12-22 16:37:00 20666 [Note] Binlog end 
2014-12-22 16:37:00 20666 [Note] InnoDB: FTS optimize thread exiting. 
2014-12-22 16:37:00 20666 [Note] InnoDB: Starting shutdown... 
2014-12-22 16:37:02 20666 [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

 


linux:~ # more .mysql_secret

# The random password set for the root user at Mon Dec 22 16:36:58 2014 (local time): lXNgZ2zmMi1MsIht

 

linux:/usr # mysql -u root -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 10

Server version: 5.6.22

 

 

mysql> 

重新設置密碼為 123456

mysql> SET PASSWORD = PASSWORD('123456');    #設置密碼為123456
mysql> exit
 
編輯 my.cnf 修改字符集:
[client]  
#password        = 123456  
port            = 3306  
default-character-set=utf8  
[mysqld]  
port            = 3306  
character_set_server=utf8  
character_set_client=utf8  
collation-server=utf8_general_ci 
lower_case_table_names=1 
datadir=/home/data/mysql 
socket=/home/data/mysql/mysql.sock
 
[mysql]  
default-character-set = utf8  
 
重新啟動  service mysql restart ,注意看是否錯誤.

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM