linux 安裝mysql和主從配置 + Spring 基於註解配置mysql讀寫分離
1. 解除安裝已有的mysql
http://www.cnblogs.com/kerrycode/p/4364465.html
2. linux yum 安裝mysql
http://www.cnblogs.com/sweet521/p/6196732.html
修改初始密碼
grep 'temporary password' /var/log/mysqld.log editPlus sftp3 port22
mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.05 sec)
mysql>
mysql>
mysql> set global validate_password_mixed_case_count=0;
Query OK, 0 rows affected (0.00 sec)
mysql> set global validate_password_number_count=3;
Query OK, 0 rows affected (0.00 sec)
mysql> set global validate_password_special_char_count=0;
Query OK, 0 rows affected (0.00 sec)
mysql> set global validate_password_length=3;
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+-------+
| Variable_name | Value |
+--------------------------------------+-------+
| validate_password_dictionary_file | |
| validate_password_length | 3 |
| validate_password_mixed_case_count | 0 |
| validate_password_number_count | 3 |
| validate_password_policy | LOW |
| validate_password_special_char_count | 0 |
+--------------------------------------+-------+
6 rows in set (0.00 sec)
4)修改簡單密碼:
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('123');
Query OK, 0 rows affected, 1 warning (0.00 sec)
SET PASSWORD = PASSWORD('root');
grant all on *.* to 'root'@'%' identified by 'root' with grant option;
3. 主從配置
http://www.cnblogs.com/alvin_xp/p/4162249.html
http://www.cnblogs.com/sustudy/p/4174189.html
配置master
server-id=1
log-bin=master-bin
binlog_checksum=none
log-bin-index=master-bin.index
binlog-do-db=business_maple
binlog-ignore-db=mysql
配置 slave :
[mysqld]
server-id=2
relay-log-index=slave-relay-bin.index
relay-log=slave-relay-bin
執行 一下程式碼
change master to master_host='192.168.0.104',master_port=3306,master_user='repl',master_password='mysql', master_log_file='master-bin.000001',master_log_pos=0;
start slave;
SpringMVC 基於註解 配置mysql 讀寫分離 + 德魯伊 + mybatis
demo 原始碼下載地址:
http://download.csdn.net/download/maple980326/9977130
參考文件
http://www.cnblogs.com/surge/p/3582248.html
application xml 配置
<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="false"/>
<aop:aspectj-autoproxy></aop:aspectj-autoproxy>
<bean id="manyDataSourceAspect" class="com.maple.dynamic.DataSourceAspect" />
<aop:config>
<aop:aspect id="c" ref="manyDataSourceAspect" order="1">
<aop:pointcut id="tx" expression="execution(public * com.maple.dao.*.*(..))"/>
<aop:before pointcut-ref="tx" method="before"/>
</aop:aspect>
</aop:config>
相關文章
- 配置\清除 MySQL 主從 讀寫分離MySql
- MySQL主從同步讀寫分離的叢集配置MySql主從同步
- mysql proxy 安裝及配置實現讀寫分離MySql
- Linux系統MySQL配置主從分離LinuxMySql
- Amoeba for MySQL讀寫分離配置MySql
- [Mysql]主從複製和讀寫分離MySql
- 基於Linux的mysql主從配置LinuxMySql
- [PHP]Larval主從讀寫分離配置PHP
- Spring+Hibernate框架下MySql讀寫分離,主從資料庫配置 (轉)Spring框架MySql資料庫
- Spring配置RoutingDataSource實現mysql讀寫分離SpringMySql
- MYSQL 主從 + ATLAS 讀寫分離 搭建MySql
- MySQL主從複製讀寫分離MySql
- MySQL主從複製與讀寫分離MySql
- 搭建MySQL主從實現Django讀寫分離MySqlDjango
- Mysql-主從複製與讀寫分離MySql
- MySQL怎麼實現主從同步和Django實現MySQL讀寫分離MySql主從同步Django
- MySQL 主從複製安裝部署配置MySql
- 【mysql】CentOS離線安裝配置MySqlMySqlCentOS
- MySQL從庫卡主了--讀寫分離也不能亂讀MySql
- MySQL基於binlog主從複製配置MySql
- Mycat中介軟體實現Mysql主從讀寫分離MySql
- MySQL運維15-一主一從讀寫分離MySql運維
- MySQL運維16-雙主雙從讀寫分離MySql運維
- mysql主從配置MySql
- mysql 主從配置MySql
- mysql配置主從MySql
- 基於docker的mysql安裝及配置DockerMySql
- Docker安裝mysql映象並進行主從配置DockerMySql
- MySQL 高可用架構:主從備份及讀寫分離MySql架構
- 網站搭建資料庫篇-Linux系統MySQL配置主從分離網站資料庫LinuxMySql
- 安裝Centos7 、 Mysql8 叢集,實現讀寫分離 高可用(五)-- MyCat配置詳解CentOSMySql
- mysql for linux 配置主從複製MySqlLinux
- 基於MySql主從分離的程式碼層實現MySql
- 【Mysql】mysql-proxy讀寫分離MySql
- MySQL Amoeba讀寫分離MySql
- Amoeba for mysql讀寫分離MySql
- MySQL讀寫分離AtlasMySql
- 10分鐘搞定Mysql主從部署配置MySql