NOVOTS KMS ʻ Glossary    ϵ Contact Us
ѯ Search  
   
Browse by Category
NOVOTS KMS .: ϵͳ .: Unix/Linux .: CentOSϵͳװMySQL̳

CentOSϵͳװMySQL̳

Ŀ¼

Ŀ¼ 1

һ жCentOSϵͳԴMySQL. 2

1.1 ǰǷװMySQL. 2

1.2 ֹͣMySQLɾ֮ǰװMySQL. 2

1.3 ѯϰ汾MySQLĿ¼ɾϰ汾MySQLļͿ... 2

1.4 ٴβһǷװMysql 3

 CentOSϵͳ߰װMysql 3

1.1 ͨyum鿴MySQL... 3

1.2 ͨyum߰װMySQL. 3

1.3 鿴װѰװ汾... 4

 CentOSϵͳֶװMySQL. 4

1.1 MySQLװļ... 4

1.2 ֶMySQLװ... 4

ġ νMySQLʼ... 5

1.1 MySQL... 5

1.2 ޸MySQLrootʼ... 5

1.3 MySQLrootû뼰֤... 6

1.4 ʵMySQLԶ... 7

1.5 ʵֿԶMySQL... 7

 οرMySQL... 8

 CentOSǽŶ˿... 8

 

 


 

1.1 ǰǷװMySQL

rpm -qa|grep -i mysql

ԿͼʾͼƬԻοʹã

     

˵ϵͳԴ
MySQL-client-5.5.25a-1.rhel5
MySQL-server-5.5.25a-1.rhel5

1.2 ֹͣMySQLɾ֮ǰװMySQL

1) ֹͣ(mysqlж֣һmysqlһmysqld)

ֹͣʽ1service mysql stop
ֹͣʽ2/etc/init.d/mysql shutdown
ֹͣʽ3service mysqld stop
ֹͣʽ4/etc/init.d/mysqld shutdown

2) ɾmysqlrpm Ce (ɾ)    rpm -e Cnodeps (ǿɾ)


rpm -ev MySQL-client-5.5.25a-1.rhel5
rpm -e Cnodeps MySQL-server-5.5.25a-1.rhel5

1.3 ѯϰ汾MySQLĿ¼ɾϰ汾MySQLļͿ

1) ѯfind / -name mysql

/var/lib/mysql
/var/lib/mysql/mysql
/usr/lib64/mysql

2) ɾrm Crf

rm -rf /var/lib/mysql
rm -rf /var/lib/mysql
rm -rf /usr/lib64/mysql

ע⣺жغ/etc/my.cnfɾҪֹɾ
 rm -rf /etc/my.cnf

1.4 ٴβһǷװMysql

ʹòѯrpm -qa|grep -i mysql
޽˵ѾжسסֱӰװmysql

1.1 ͨyumMySQL

߲鿴汾yum list | grep mysql

ͼͼƬԻοʹã

 

1.2 ͨyum߰װMySQL

߰װyum install(װ)  yum install Cy(װ)

yum install mysql-server

yum install Cy mysql-server mysql mysql-deve

װɹͼͼƬԻοʹã

 

1.3 鿴װѰװ汾

鿴Ѱװ汾rpm -qi mysql-server

1.1 MySQLװļ

1) ֻҪװmysqlôֻҪװļ

MySQL-server-5.5.25-1.rhel5  (ذ汾߰汾Ҫݰ)

MySQL-devel-5.5.25-1.rhel5   (ذ汾߰汾Ҫݰ)

MySQL-client-5.5.25-1.rhel5   (ذ汾߰汾Ҫݰ)

1.2 ֶMySQLװ

1) նˣMySQLװļĿ¼

cd /opt/install

2) װMySQL

װRMPļװrpm Civh

װBINļװ./

rpm -ivh MySQL-server-5.5.25a-1.rhel5.x86_64.rpm

./MySQL-server-5.5.25a-1.rhel5.x86_64.bin

ע⣺װֵ̻Ĵ()

Ϣ

[root@localhost upload]# rpm -ivh MySQL-server-5.5.25a-1.rhel5.x86_64.rpm
error: Failed dependencies:
libaio.so.1()(64bit) is needed by MySQL-server-5.5.25a-1.rhel5.x86_64
libaio.so.1(LIBAIO_0.1)(64bit) is needed by MySQL-server-5.5.25a-1.rhel5.x86_64
libaio.so.1(LIBAIO_0.4)(64bit) is needed by MySQL-server-5.5.25a-1.rhel5.x86_64

ϴϢԿΪȱٿlibaioҪlibaioⰲװ

װ밲װMySQLһ

3) װMySQLͻˡMySQL-devel

rpm -ivh MySQL- client -5.5.25a-1.rhel5.x86_64.rpm

./MySQL- client -5.5.25a-1.rhel5.x86_64.bin

rpm -ivh MySQL- devel -5.5.25a-1.rhel5.x86_64.rpm

./MySQL- devel -5.5.25a-1.rhel5.x86_64.bin

װɹͼͼƬԻοʹã

 

1.1 MySQL

ʽ1service mysql start
ʽ2/etc/init.d/mysql start
ʽ3service mysqld start
ʽ4/etc/init.d/mysqld start

1.2 ޸MySQLrootʼ

װMySQLɹrootʼΪ

MySQLmysql Cu root Cp

ͼͼƬԻοʹã

 

޸ijʼ/usr/bin/mysqladmin -u root password rootadmin
ʽmysqladmin -uû -p password

ע⣺޷MySQL2

һڣδ

һڣ ο1.3MySQL rootû룩

ϵQQ:807002272

1.3 MySQLrootû뼰֤

Ø ޸root

1) ֹͣMySQL:

/etc/init.d/mysqld stop

/etc/init.d/mysql stop

2) ƹ֤

mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

3) ¼û

mysql -u root mysql

4) ޸rootSQL

update user set Password=password ('123456') where user='root';

5) ˢ

FLUSH PRIVILEGES;

6) ˳MySQL

quit;

Ø ֤rootǷ޸ijɹ

1) ¼MySQLmysql Cu root Cp(޸ĵ)

mysql Cu root Cp123456

1.4 ʵMySQLԶ

ע⣺CentOSϵͳǽ↑MySQLʶ˿

1) ı

mysql -u root -pvmware

mysql> use mysql;
mysql> update user set host = % where user = root;
mysql> select host, user from user;

mysql> flush privileges;

mysql> quit;

2) Ȩ

mysql> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

mysql> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword WITH GRANT OPTION;

1.5 ʵֿԶMySQL

1) MySQLǷԶ

 chkconfig --list | grep mysqld

 chkconfig --list | grep mysql

2) MySQLԶ

chkconfig mysqld on

chkconfig mysql on

ʽ1service mysql start
ʽ2/etc/init.d/mysql start
ʽ3service mysqld start
ʽ4/etc/init.d/mysqld start


ֹͣʽ1service mysql stop
ֹͣʽ2/etc/init.d/mysql shutdown
ֹͣʽ3service mysqld stop
ֹͣʽ4/etc/init.d/mysqld shutdown


ʽ1service mysql restart
ʽ2/etc/init.d/mysql restart
ʽ3service mysqld restart
ʽ4/etc/init.d/mysqld restart

Ø iptablesļ

vi /etc/sysconfig/iptables  

Ø ʹǽŶ˿

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport ˿ -j ACCEPT  

Ø رաǽ

/etc/init.d/iptables stop   ر

/etc/init.d/iptables start    

/etc/init.d/iptables restart   

 

Ø Թرշǽ

chkconfig --level 35 iptables off  

 /etc/init.d/iptables stop  

 iptables -P INPUT DROP  

Ø ģʽ˿

iptables -A INPUT -p tcp --dport ˿ -j ACCEPT  

Ø 򿪱ģʽ˿~˿֮

iptables -A INPUT -p tcp --dport ˿: ˿ -j ACCEPT  

 iptables -A INPUT -i lo -j ACCEPT  

 iptables -A INPUT -m state --state ESTABLISHED -j ACCEPT  


ƪ¶ã

article Mysql ɾַı
ڹ˾ҵӦõĵ֮ǰMysqlеĺܶ...

(No rating)  7-21-2014    Views: 974   
article mysqlȨ
 

(No rating)  5-25-2020    Views: 34   
article MySQL뵼
1.ݿ mysqldump -u û...

(No rating)  11-28-2011    Views: 982   

û

ǰû.


.: .: .: .: .:
[ ½ ]
Ƽ޹˾ 2006

Novots Technologies Limited