成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

SuSE11下如何使用rpm安裝包安裝MySQL5.5.60-創(chuàng)新互聯(lián)

下文主要給大家?guī)?lái)SuSE11下如何使用rpm安裝包安裝MySQL5.5.60,希望這些內(nèi)容能夠帶給大家實(shí)際用處,這也是我編輯SuSE11下如何使用rpm安裝包安裝MySQL5.5.60這篇文章的主要目的。好了,廢話不多說(shuō),大家直接看下文吧。

公司主營(yíng)業(yè)務(wù):做網(wǎng)站、網(wǎng)站設(shè)計(jì)、移動(dòng)網(wǎng)站開(kāi)發(fā)等業(yè)務(wù)。幫助企業(yè)客戶(hù)真正實(shí)現(xiàn)互聯(lián)網(wǎng)宣傳,提高企業(yè)的競(jìng)爭(zhēng)能力。創(chuàng)新互聯(lián)公司是一支青春激揚(yáng)、勤奮敬業(yè)、活力青春激揚(yáng)、勤奮敬業(yè)、活力澎湃、和諧高效的團(tuán)隊(duì)。公司秉承以“開(kāi)放、自由、嚴(yán)謹(jǐn)、自律”為核心的企業(yè)文化,感謝他們對(duì)我們的高要求,感謝他們從不同領(lǐng)域給我們帶來(lái)的挑戰(zhàn),讓我們激情的團(tuán)隊(duì)有機(jī)會(huì)用頭腦與智慧不斷的給客戶(hù)帶來(lái)驚喜。創(chuàng)新互聯(lián)公司推出平度免費(fèi)做網(wǎng)站回饋大家。

一、環(huán)境準(zhǔn)備

操作系統(tǒng):SuSE版本11sp3,64位

kingtry:~ # uname -a
Linux kingtry 3.0.76-0.11-default #1 SMP Fri Jun 14 08:21:43 UTC 2013 (ccab990) x86_64 x86_64 x86_64 GNU/Linux
kingtry:~ # cat /etc/SuSE-release 
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 3

二、檢測(cè)是否安裝過(guò)MySQL

kingtry:~ # rpm -qa | grep -i  mysql
libmysqlclient_r15-5.0.96-0.6.1
libqt4-sql-mysql-4.6.3-5.25.4
MySQL-client-community-5.1.73-1.sles11
MySQL-server-community-5.1.73-1.sles11

注意輸出的MySQL-*,表示已經(jīng)安裝過(guò)。lib開(kāi)頭的可以忽略。

輸入以下命令刪除:

kingtry:~ #rpm -e MySQL-client-community-5.1.73-1.sles11
kingtry:~ #rpm -e MySQL-server-community-5.1.73-1.sles11

三、軟件準(zhǔn)備

MySQL-server-5.5.60-1.sles11.x86_64.rpm
MySQL-client-5.5.60-1.sles11.x86_64.rpm

四、安裝過(guò)程

kingtry:~ # rpm -ivh MySQL-server-5.5.60-1.sles11.x86_64.rpm MySQL-client-5.5.60-1.sles11.x86_64.rpm 
warning: MySQL-server-5.5.60-1.sles11.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 5072e1f5
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
180620 17:57:38 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
180620 17:57:38 [Note] /usr/sbin/mysqld (mysqld 5.5.60) starting as process 3576 ...
180620 17:57:39 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
180620 17:57:39 [Note] /usr/sbin/mysqld (mysqld 5.5.60) starting as process 3583 ...

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 kingtry 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/

五、安裝完成

簡(jiǎn)單的安裝過(guò)程,只需上面一個(gè)命令即可,當(dāng)前版本root密碼為空,可以使用mysql命令直接連接登陸。

注:默認(rèn)安裝之后mysql服務(wù)并沒(méi)有自動(dòng)啟動(dòng)

六、安裝后配置之遷移數(shù)據(jù)庫(kù)目錄

rpm這種安裝方式默認(rèn)將數(shù)據(jù)文件安裝到/var/lib/mysql這個(gè)目錄下面,通常都需要遷移到其他目錄下,如遷移到/data目錄下

kingtry:~ # mkdir  /data
kingtry:~ # mv  /var/lib/mysql  /data

需要注意的是,在此之前,mysql相關(guān)配置都是采用默認(rèn)值。如果mysql所有選項(xiàng)都采用默認(rèn)值,則即使沒(méi)有my.cnf這個(gè)文件,服務(wù)也能正常啟動(dòng)。

但是,我們修改了數(shù)據(jù)文件的路徑,那就要在my.cnf中指定。

1,復(fù)制my.cnf模板文件

  模板文件在/usr/share/mysql目錄下,有多個(gè),復(fù)制其中任意一個(gè)

kingtry:~ # cp  /usr/share/mysql/my-medium.cnf  /etc/my.cnf

修改相關(guān)參數(shù),主要是socket, datadir, 如下:

# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients

[client]
#password       = your_password
port            = 3306
socket          = /data/mysql/mysql.sock
default-character-set=utf8
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port            = 3306
datadir         = /data/mysql
socket          = /data/mysql/mysql.sock
character-set-server=utf8
pid-file=/data/mysql/mysql.pid
user = mysql	

lower_case_table_names=1
max_connections=1000

#bind-address = 127.0.0.1

#skip-name-resolve
skip-external-locking

key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
# 
#skip-networking

# Replication Master Server (default)
# binary logging is required for replication
log-bin=/data/mysql/mysql-bin

# binary logging format - mixed recommended
binlog_format=mixed

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id	= 1

# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
#    the syntax is:
#
#    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
#    where you replace <host>, <user>, <password> by quoted strings and
#    <port> by the master's port number (3306 by default).
#
#    Example:
#
#    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
#    MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
#    start replication for the first time (even unsuccessfully, for example
#    if you mistyped the password in master-password and the slave fails to
#    connect), the slave will create a master.info file, and any later
#    change in this file to the variables' values below will be ignored and
#    overridden by the content of the master.info file, unless you shutdown
#    the slave server, delete master.info and restart the slaver server.
#    For that reason, you may want to leave the lines below untouched
#    (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id       = 2
#
# The replication master for this slave - required
#master-host     =   <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user     =   <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password =   <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port     =  <port>
#
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/lib/mysql
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

slow_query_log = 1
long_query_time = 10
log-queries-not-using-indexes

log-error=/data/mysql/mysql.err

expire-logs-days = 10

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

七、啟動(dòng)mysql服務(wù)即可

kingtry:~ # service mysql start                                                                                                                                                     done
Starting MySQL.                                                                                                                                                                done
kingtry:~ #

檢查MySQL服務(wù)是否已經(jīng)啟動(dòng):

kingtry:~ # netstat -nat | grep 3306

八、安裝后配置之root密碼修改

默認(rèn)情況下root密碼為空,這在生產(chǎn)環(huán)境下肯定不行的。修改root密碼的方式有以下兩種,隨便哪個(gè)都行:

1、命令方式(注:首次修改密碼,修改前密碼為空)

kingtry:~ # mysqladmin -u root password 'root123'

要注意如果執(zhí)行以上步驟之后root密碼已經(jīng)不為空,如果此時(shí)想再次修改root密碼,上面命令就不行了,需要用到下面的命令:

kingtry:~ # mysqladmin -u root -p  password 'root1234' 
Enter password:

這是交互式方式修改,輸入的當(dāng)前密碼,password參數(shù)后面跟隨的是想要修改成的密碼

2、修改庫(kù)表數(shù)據(jù)方式

先登陸mysql云服務(wù)器

mysql>  use mysql
mysql>  update user set password=password('root123') where user='root';
mysql>  commit;

九、防火墻允許3306端口

kingtry:~ # vi /etc/sysconfig/SuSEfirewall2

在FW_SERVICES_EXT_TCP增加3306端口,如果存在其他端口,則空格隔開(kāi),如:

FW_SERVICES_EXT_TCP="21 22 3306"

重啟防火墻:

# rcSuSEfirewall2 restart

十、設(shè)置遠(yuǎn)程訪問(wèn)

 先登陸mysql云服務(wù)器,授權(quán)root用戶(hù)可以遠(yuǎn)程登陸

mysql> grant all PRIVILEGES on *.* to root@'%' identified by 'root123'; 
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql>

注:生產(chǎn)環(huán)境最好只允許root在特定IP的機(jī)器上才能遠(yuǎn)程訪問(wèn)。

對(duì)于以上關(guān)于SuSE11下如何使用rpm安裝包安裝MySQL5.5.60,大家是不是覺(jué)得非常有幫助。如果需要了解更多內(nèi)容,請(qǐng)繼續(xù)關(guān)注我們的行業(yè)資訊,相信你會(huì)喜歡上這些內(nèi)容的。

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性?xún)r(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專(zhuān)為企業(yè)上云打造定制,能夠滿(mǎn)足用戶(hù)豐富、多元化的應(yīng)用場(chǎng)景需求。

本文標(biāo)題:SuSE11下如何使用rpm安裝包安裝MySQL5.5.60-創(chuàng)新互聯(lián)
分享地址:http://jinyejixie.com/article6/digsig.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站建設(shè)服務(wù)器托管、域名注冊(cè)、軟件開(kāi)發(fā)、Google、用戶(hù)體驗(yàn)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

營(yíng)銷(xiāo)型網(wǎng)站建設(shè)
诸城市| 梁平县| 宣城市| 伊金霍洛旗| 洛南县| 黄陵县| 正安县| 彭泽县| 新平| 姚安县| 抚州市| 永济市| 洛川县| 文成县| 贡觉县| SHOW| 资溪县| 石嘴山市| 宜川县| 瓦房店市| 临朐县| 延川县| 左权县| 哈尔滨市| 子长县| 道真| 曲周县| 凌海市| 安溪县| 南通市| 依兰县| 玛纳斯县| 叶城县| 仁布县| 荔波县| 保亭| 宜兰县| 乌恰县| 晋宁县| 铁岭市| 长宁县|