【MySQL】迁移数据目录 php

WBOY
Release: 2016-06-23 13:23:42
Original
1094 people have browsed it

////  move dir

# mv /var/libmysql /mnt/data/



////  vi /etc/my.cnf

【mysqld】  // 服务器端

datadir=/mnt/data/mysql

socket=/mnt/data/mysql/mysql.sock


【mysql】  // 客户端

socket=/mnt/data/mysql/mysql.sock



/// restart to check


/// need to update config in /etc/php.ini

pdo_mysql.default_socket=/mnt/data/mysql/mysql.sock

mysql.default_socket = /mnt/data/mysql/mysql.sock

mysqli.default_socket = /mnt/data1/mysql/mysql.sock


/// reference : http://www.aiezu.com/db/mysql_cant_connect_through_socket.html


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!