centos5.5中安装mysql5.5.3
1.掛載linux的光盤源
mount /dev/cdrom /media/
cd /etc/yum.repos.d/
rm -rf CentOS-Base.repo
vim CentOS-Media.repo
2.安裝編譯mysql源碼必需的程序
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
3.編譯安裝mysql
./configure –prefix=/usr/local/mysql –without-debug –enable-thread-safe-client –with-pthread –enable-assembler –enable-profiling –with-mysqld-ldflags=-all-static –with-client-ldflags=-all-static –with-extra-charsets=all –with-plugins=all –with-mysqld-user=mysql –without-embedded-server –with-server-suffix=-community –with-unix-socket-path=/tmp/mysql.sock && make && make install
4.創建mysql用戶
useradd mysql
5.設置mysql安裝目錄的權限給mysql用戶
setfacl -m u:mysql:rwx -R /usr/local/mysql
setfacl -m d:u:mysql:rwx -R /usr/local/mysql
6.安裝mysql和test數據庫
/usr/local/mysql/bin/mysql_install_db –user=mysql
7.啟動mysql服務
/usr/local/mysql/bin/mysqld_safe –user=mysql &
8.修改mysql的登陸密碼為123
/usr/local/mysql/bin/mysqladmin -uroot password “123”
9.使用mysql用戶登陸數據庫
/usr/local/mysql/bin/mysql -uroot -p123
10.備份配置mysql的配置文件
cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
11.配置mysql的配置文件
vi /etc/my.cnf
#修改客戶端的連接字符集 default-character-set=utf8 #修改服務器和數據庫字符集 character-set-server=utf8 #修改服務器校驗字符集 collation-server=utf8_general_ci12.重啟mysql服務,讓字符集生效
pkill mysqld
/usr/local/mysql/bin/mysqld_safe –user=mysql &
總結
以上是生活随笔為你收集整理的centos5.5中安装mysql5.5.3的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: shell去掉^M
- 下一篇: ORACLE IMP-00017: fo