mysql数据库默认路径修改
启动httpd服务
<strong>mkdir -p /run/httpd</strong><strong><br></strong><strong>systemctl start httpd.service</strong>
在linux系统中代表:多个进程+多个线程+多个预分配内存结构
一般用来测试环境中,测试主从,高可用等。
多实例配置方案:(多个数据库管理系统)
端口port分开 配置文件分开 socket分开 日志分开 多serverid 都可以使用mysql用户 #总结,初始化多次数据库
创建目录修改权限
<strong>mkdir /share/work/mysql mkdir /share/work/mysql/3306<br></strong><strong>chown mysql:mysql -R /share/work/mysql</strong>
修改mysql配置文件,执行“vi /share/work/mysql/3306/my.cnf ”命令并确定。
cp /etc/my.cnf /share/work/mysql
[mysqld] basedir=/opt/rocks/mysql datadir=/share/work/mysql/3306/data port=3306 socket=/share/work/mysql/3306/mysql.sock log-error=/share/work/mysql/3306/data/mysql.err log-bin=/share/work/mysql/3306/data/mysql-bin server_id=7
安装数据库
groupadd mysql
useradd -r -g mysql mysql
--skip-grant-tables
设置开机启动:
初始化密码并且授权远程登录
/share/work/mysql/3306/mysql.sock
#6.关闭多实例
[root@db01 scripts]# mysqladmin -S /share/work/mysql/3306/mysql.sock shutdown
#7.检查端口
[root@db01 scripts]# netstat -lntup|grep 330
tcp6 0 0 :::3306 :::* LISTEN 25550/mysqld
#8.设置多实例密码
[root@db01 scripts]# mysqladmin -uroot -S /share/work/mysql/3306/mysql.sock password '3306'
#9.验证库连接( 查看server_id )
[root@db01 scripts]# mysql -uroot -p3306 -S /share/work/mysql/3306/mysql.sock -e "show variables like 'server_id';"Warning: Using a password on the command line interface can be insecure.
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| server_id | 7 |
+---------------+-------+
以上是rocks mysql数据库多实例数据库配置的示例分析的详细内容。更多信息请关注PHP中文网其他相关文章!