您好,登錄后才能下訂單哦!
1、安裝環境準備
# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
# yum install cmake -y # yum install ncurses-devel -y # useradd -s /sbin/nologin -M mysql
2、編譯環境準備
# mkdir /usr/local/mysql # mkdir /software # cd /software/
# tar -zxvf mysql-5.5.32.tar.gz #上傳文件:mysql-5.5.32.tar.gz 到: /software 目錄 # cd mysql-5.5.32
# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/usr/local/mysql/data \
-DMYSQL_UNIX_ADDR=/usr/local/mysql/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii \
-DENABLED_LOCAL_INFILE=ON \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
-DWITHOUT_PARTITION_STORAGE_ENGINE=1 \
-DWITH_FAST_MUTEXES=1 \
-DWITH_ZLIB=bundled \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_READLINE=1 \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_DEBUG=0
# make && make install
3、初始化MySQL數據庫
# /usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql/ \
--datadir=/usr/local/mysql/data \
--user=mysql #初始化數據庫 # cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld ##修改文件:/etc/my.cnf ,因為我的MySQL安裝在/usr/local/mysql目錄下面 #[mysqld] # datadir = /usr/local/mysql/data # socket=/usr/local/mysql/tmp/mysql.sock
# sed -i 's/datadir=\/var\/lib\/mysql/datadir=\/usr\/local\/mysql\/data/g' /etc/my.cnf
# sed -i 's/socket=\/var\/lib\/mysql\/mysql.sock/socket=\/usr\/local\/mysql\/tmp\/mysql.sock/g' /etc/my.cnf
# chown -R mysql.mysql /usr/local/mysql # /etc/init.d/mysqld start #啟動數據庫服務 # /usr/local/mysql/bin/mysql # cp /usr/local/mysql/bin/mysql /usr/local/sbin/ #把mysql客戶端程序復制到/usr/local/sbin/目錄下面 # /usr/local/mysql/bin/mysqladmin -u root password '123456' #更改root用戶密碼 # mysql -uroot –p123456
>drop user ""@Lab-Srv-02;
>drop user "root"@"::1";
>drop user ""@"localhost";
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。