mariadb 壓縮包gz安裝方式


1.解壓安裝包
tar -zxvf mariadb-5.5.56-linux-x86_64.tar.gz

2.cd support-files
cp my-small.cnf /etc/my.cnf

2.修改配置文件
[mysqld]
port = 3306
basedir = /home/marridb/mariadb-5.5.56-linux-x86_64
socket = /home/marridb/mariadb-5.5.56-linux-x86_64/mysql.sock
datadir = /home/marridb/mariadb-5.5.56-linux-x86_64/data/marridb
skip-external-locking
key_buffer_size = 256M
max_allowed_packet = 64M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
thread_concurrency = 8
log-bin=mysql-bin
binlog_format=mixed
server-id = 1
lower_case_table_names = 1
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake


3.初始化數據庫
scripts/mysql_install_db --datadir=/home/marridb/mariadb-5.5.56-linux-x86_64/data --defaults-file=/etc/my.cnf --user=mysql

chown -R root .
cp support-files/mysql.server /etc/init.d/mysqld

chkconfig --add mysqld # 添加至系統服務
chkconfig mysqld on # 設置開機自啟動

4.后台運行
cd bin
mysqld_safe --datadir='/home/marridb/mariadb-5.5.56-linux-x86_64/data' &

5.link 文件
ln -s /home/marridb/mariadb-5.5.56-linux-x86_64/mysql.sock /tmp/mysql.sock

6.測試
cd bin
./mysql

7.設置密碼
mysqladmin -u root password "root123456"

8.登錄並授權
mysql -uroot -p

9.root可從任何IP登錄
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypwd' WITH GRANT OPTION;
mysql>FLUSH RIVILEGES;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM