Redhat9.2 安裝MySQL5.0
一開始學習資料庫就是用的MySQL,之後就是Informix,現在是使用ORACLE,現在由於學習研究開發一個基於負載平衡的網路監控系統需要想使用MySQL,
感覺有點生疏,現就MySQL5.0在linux下安裝的經驗總結一下:
在http://www.mysql.com/downloads/選擇要安裝的版本,
1.安裝MySQL需要下面兩個檔案:
MySQL-server-4.0.16-0.i386.rpm
MySQL-client-4.0.16-0.i386.rpm
[root@MT src]# rpm -ivh MySQL-server-community-5.0.41-0.rhel4.i386.rpm
warning: MySQL-server-community-5.0.41-0.rhel4.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
Preparing... ########################################### [100%]
1:MySQL-server-community ########################################### [100%]
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 MT password 'new-password'
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
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
Starting MySQL.......... SUCCESS!
如碰到安裝失敗(如perl(DBI)),只要安裝相應的軟體即可!
同理,安裝 MySQL-client-4.0.16-0.i386.rpm
[root@MT src]# rpm -ivh MySQL-client-4.0.16-0.i386.rpm
2.修改MySQL密碼
[root@MT src]# mysqladmin -u root password mysql
3.MySQL資料庫管理
(1)關閉與啟動
[root@MT src]# mysqladmin -u root -p shutdown
[root@MT src]# /et/init.d/mysql start
(2)更換MySQL目錄
[root@MT src]# mysqladmin -u root -p shutdown
[root@MT src]# cp /var/lib/mysql /home/mysql/5.0/
[root@MT src]# cp /usr/share/mysql/my-medium.cnf /etc/my.cnf
[root@MT src]# cp /usr/share/mysql/my-medium.cnf /etc/my.cnf
[root@MT src]# vi /etc/my.cnf
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
##Modified content MartriWang@gmail.com
#socket = /var/lib/mysql/mysql.sock
socket = /home/mysql/5.0/mysql/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
#socket = /var/lib/mysql/mysql.sock
##Modified content MartriWang@gmail.com
socket = /home/mysql/5.0/mysql/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
[root@MT src]# vi /etc/init.d/mysql
# The following variables are only set for letting mysql.server find things.
# Set some defaults
pid_file=
server_pid_file=
use_mysqld_safe=1
user=mysql
if test -z "$basedir"
then
basedir=/
bindir=/usr/bin
if test -z "$datadir"
then
##Modified content MartriWang@gmail.com
# datadir=/var/lib/mysql
datadir=/home/mysql/5.0/mysql
[root@MT src]#/etc/init.d/mysql start
(3)MySQL目錄
資料庫目錄:/var/lib/mysql/(可更改,前面已經介紹)
配置檔案:/usr/share/mysql(mysql.server命令及配置檔案)
相關命令:/usr/bin(mysqladmin mysqldump等命令)
啟動指令碼:/etc/rc.d/init.d/(ln -s /etc/init.d/)(啟動指令碼檔案mysql的目錄)
(4)備份與恢復
備份:[root@MT src]#mysqldump -u root -p --opt mysql > mysql_back
恢復:[root@MT src]#mysql -u root -p mysql < mysql_back
相關文章
- 安裝npm 解除安裝npm 安裝apidocNPMAPI
- BiocManager安裝,devtools安裝dev
- Linux安裝解除安裝MySQLLinuxMySql
- linux 安裝yum 安裝phpLinuxPHP
- Ubuntu解除安裝和安裝Ubuntu
- 02 安裝git、安裝TortoiseGitGit
- cocoapods安裝/解除安裝/使用
- JDK安裝和解除安裝JDK
- ffmpeg安裝之mac安裝Mac
- docker安裝及解除安裝Docker
- [ 安裝 ] Zeppelin安裝步驟!
- win10安裝版怎麼安裝_安裝版win10安裝教程Win10
- ElasticSearch的安裝和使用,Postman的安裝,Kibana的安裝,EShead外掛的安裝ElasticsearchPostman
- Mac Redis安裝與解除安裝MacRedis
- 安裝了IDLE後安裝tensorflow
- kratos安裝及依賴安裝
- Linux 解除安裝openjdk 安裝oraclejdkLinuxJDKOracle
- debian安裝和解除安裝vmware
- JDK的安裝與解除安裝JDK
- linux 解除安裝jdk和安裝LinuxJDK
- 【推薦 - glibc安裝】MySQL - 安裝MySql
- linux下安裝snap安裝工具Linux
- [雲原生]Docker - 安裝&解除安裝Docker
- Ubuntu安裝和解除安裝mongodbUbuntuMongoDB
- window下安裝並使用nvm(含解除安裝node、解除安裝nvm、全域性安裝npm)NPM
- 安裝
- air安裝win10怎麼解除安裝_air安裝win10如何解除安裝AIWin10
- Centos Docker安裝、升級、解除安裝CentOSDocker
- Webpack學習 – Webpack安裝及安裝Web
- Linux-Ubuntu-mysql-安裝&解除安裝LinuxUbuntuMySql
- Centos7.9安裝解除安裝DockerCentOSDocker
- Centos7安裝安裝部署dockerCentOSDocker
- Linux系統安裝——Centos 7.6安裝LinuxCentOS
- PostgreSQL 10.12 安裝系列 - 原始碼安裝SQL原始碼
- PostgreSQL 10.12 安裝系列 - 本地RPM安裝SQL
- 【 Linux 軟體安裝 】- 1 JDK安裝LinuxJDK
- Python pip的安裝及解除安裝Python
- CentOS7安裝php、安裝MySqlCentOSPHPMySql
- vs2015解除安裝和安裝