mysql 5.5 .17 配置多实例教程


本文主要给大家简单讲讲mysql 5.5 .17 配置多实例教程,相关专业术语大家可以上网查查或者找一些相关书籍补充一下,这里就不涉猎了,我们就直奔主题吧,希望mysql 5.5 .17 配置多实例教程这篇文章可以给大家带来一些实际帮助。1:创建 /data/3307/data2: :修改my.cnf# Example MySQL config file for medium systems.## This is for a system with little memory (32M – 64M) where MySQL plays# an important part, or systems up to 128M where MySQL is used together with# other programs (such as a web server)## MySQL programs look for option files in a set of# locations which depend on the deployment platform.# You can copy this option file to one of those# locations. For information about these locations, see:# http://dev.mysql.com/doc/mysql/en/option-files.html## In this file, you can use all long options that a program supports.# If you want to know which options a program supports, run the program# with the “–help” option.# The following options will be passed to all MySQL clients[client]#password= your_passwordport= 3307socket= /data/3307/mysql.sock# Here follows entries for some specific programs# The MySQL server[mysqld]port= 3307socket= /data/3307/mysql.sockbasedir = /application/mysqldatadir = /data/3307/dataskip-external-lockingkey_buffer_size = 16Mmax_allowed_packet = 1Mtable_open_cache = 64sort_buffer_size = 512Knet_buffer_length = 8Kread_buffer_size = 256Kread_rnd_buffer_size = 512Kmyisam_sort_buffer_size = 8M# Don’t listen on a TCP/IP port at all. This can be a security enhancement,# if all processes that need to connect to mysqld run on the same host.# All interaction with mysqld must be made via Unix sockets or named pipes.# Note that using this option without enabling named pipes on Windows# (via the “enable-named-pipe” option) will render mysqld useless!##skip-networking# Replication Master Server (default)# binary logging is required for replicationlog-bin=mysql-bin# binary logging format – mixed recommendedbinlog_format=mixed# required unique id between 1 and 2^32 – 1# defaults to 1 if master-host is not set# but will not function as a master if omittedserver-id= 7# Replication Slave (comment out master section to use this)## To configure this host as a replication slave, you can choose between# two methods :## 1) Use the CHANGE MASTER TO command (fully described in our manual) -# the syntax is:## CHANGE MASTER TO MASTER_HOST=, MASTER_PORT=,# MASTER_USER=, MASTER_PASSWORD= ;## where you replace , , by quoted strings and# by the master’s port number (3306 by default).## Example:## CHANGE MASTER TO MASTER_HOST=’125.564.12.1′, MASTER_PORT=3306,# MASTER_USER=’joe’, MASTER_PASSWORD=’secret’;## OR## 2) Set the variables below. However, in case you choose this method, then# start replication for the first time (even unsuccessfully, for example# if you mistyped the password in master-password and the slave fails to# connect), the slave will create a master.info file, and any later# change in this file to the variables’ values below will be ignored and# overridden by the content of the master.info file, unless you shutdown# the slave server, delete master.info and restart the slaver server.# For that reason, you may want to leave the lines below untouched# (commented) and instead use CHANGE MASTER TO (see above)## required unique id between 2 and 2^32 – 1# (and different from the master)# defaults to 2 if master-host is set# but will not function as a slave开发云主机域名 if omitted#server-id = 2## The replication master for this slave – required#master-host = ## The username the slave will use for authentication when connecting# to the master – required#master-user = ## The password the slave will authenticate with when connecting to# the master – required#master-password = ## The port the master is listening on.# optional – defaults to 3306#master-port = ## binary logging – not required for slaves, but recommended#log-bin=mysql-bin
# Uncomment the following if you are using InnoDB tables#innodb_data_home_dir = /application/mysql/data#innodb_data_file_path = ibdata1:10M:autoextend#innodb_log_group_home_dir = /application/mysql/data# You can set .._buffer_pool_size up to 50 – 80 %# of RAM but beware of setting memory usage too high#innodb_buffer_pool_size = 16M#innodb_additional_mem_pool_size = 2M# Set .._log_file_size to 25 % of buffer pool size#innodb_log_file_size = 5M#innodb_log_buffer_size = 8M#innodb_flush_log_at_trx_commit = 1#innodb_lock_wait_timeout = 50[mysqld_safe]log-error=/data/3307/ilanni.errpid-file=/data/3307/ilanni.pid[mysqldump]quickmax_allowed_packet = 16M[mysql]no-auto-rehash# Remove the next comment character if you are not familiar with SQL#safe-updates[myisamchk]key_buffer_size = 20Msort_buffer_size = 20Mread_buffer = 2Mwrite_buffer = 2M[mysqlhotcopy]interactive-timeout3:安装多实例/application/mysql/scripts/mysql_install_db –basedir=/application/mysql –datadir=/data/3307/data –user=mysql这个是因为我们初始化加入–user=mysql这个选项。当然这个也是我们所需要的,因为这增加了mysql的安全性。4:修改mysql实例的数据库目录权限chown -R mysql:mysql /data/33075:启动多实例/application/mysql/bin/mysqld_safe –defaults-file=/data/3307/my.cnf & //停止多实例/application/mysql/bin/mysqladmin -uroot -p2017 -S /data/3307/mysql.sock -P3308 shutdown6:查看 3307mysqld进程是否启动ps aux |grep mysqld7:登录多实例mysql -uroot -p -S /data/3307/mysql.sock登录成功[root@test tmp]# mysql -uroot -p -S /data/3307/mysql.sockEnter password:Welcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 1Server version: 5.5.17-log Source distributionCopyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the current input statement.mysql>mysql 5.5 .17 配置多实例教程就先给大家讲到这里,对于其它相关问题大家想要了解的可以持续关注我们的行业资讯。我们的板块内容每天都会捕捉一些行业新闻及专业知识分享给大家的。

相关推荐: (转)MySQL ORDER BY 的实现分析

总的来说,在 MySQL 中的ORDER BY有两种排序实现方式,一种是利用有序索引获取有序数据,另一种则是通过相应的排序算法,将取得的数据在内存中进行排序。下面将通过实例分析两种排序实现方式及实现图解: 假设有 Table A 和 B 两个表结构分别如下:1…

免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。

(0)
打赏 微信扫一扫 微信扫一扫
上一篇 06/07 20:06
下一篇 06/07 20:06

相关推荐