linux系统如何查找mysql所在端口?
my.ini(Linux系统下是my.cnf),当mysql服务器启动时它会读取这个文件,设置相关的运行环境参数。此文件中有一个参数是port;port=3306#设置mysql客户端连接服务端时默认使用的端口找到mysql运行目录下的my.ini(Linux系统下是my.cnf),查看此参数即可。
linux怎么快速导入Mysql数据库与?
1、MySQL数据库导出/usr/local/mysql/bin/mysqldump -u root -p123456 test> /home/backup/test.sql其中:root为数据库用户名123456为对应root数据库密码test是需要导出的数据库名。/home/backup/test.sql是数据库文件sql导出的路径。
2、MySQL数据库导入/usr/local/mysql/bin/mysql -u root -p123456 test
linux下mysql怎么启动不了了?
修改mysql配置文件
vi /etc/my.cnf
1.
default-character-set=utf8
2.
character-set-server=utf8
collation-server = utf8_general_ci
生成MySQL配置文件
setfacl -m u:mysql:rwx -R /usr/local/mysql
setfacl -m d:u:mysql:rwx -R /usr/local/mysql
用acl来让mysql用户对/usr/local/mysql有所有权限
/usr/local/mysql/bin/mysql_install_db --user=mysql
创建数据库授权表
启动MySQL服务:
1.用原本源代码的方式去使用和启动mysql
/usr/local/mysql/bin/mysqld_safe --user=mysql &
2.重启以后还要生效:
vi /etc/rc.local
/usr/local/mysql/bin/mysqld_safe --user=mysql &