Mysql
来自ling
mysql升级到5.7
备份所有数据库
安装新数据库
使用--initialize初始化数据库 #-initialize-insecure root密码为空
copy生产的mysql数据库到data目录
启动数据库,在wangbo.err中找到初始密码,链接数据库 密码更多参考http://www.jb51.net/article/77858.htm
修改默认密码 update mysql.user set authentication_string=password('2009') where user='root' and Host = 'localhost';
重启数据库
修改max_allowed_packet=100M
还原数据库
任意ip访问
通过CMD命令行修改数据库表的一个字段的值,实现连接,访问。
第一步、找到MYSQL软件安装所在的bin目录;
(1)cd\当前目录
(2)指定MYSQL安装的bin目录
(3)输入 mysql -h localhost -u root -p;出现输入密码,此时输入你在安装MYSQL软件设置的密码即可。
你会看到进入了sql命令行
(4)输入 use mysql;
切换到mysql数据库
可以用select user,host from user;查看用户配置,我们的目的是要把localhost用%代替即可。
(5)使用update user set host='%' where host='localhost';语句更新即可。
(6)修改成这个样子就ok了。
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Wb19831010!' WITH GRANT OPTION; FLUSH PRIVILEGES;
输入如上语句查询结果如下:
此时,MYSQL就可以用任何IP地址来访问了。
mysql.ini配置
[mysqld]
basedir=D:/server/mysql/
datadir=D:/server/mysqldata/Data/
[client]
no-beep
port=3306
[mysql]
default-character-set=utf8
[mysqld]
port=3306
character-set-server=utf8
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
log-output=FILE
general-log=0
general_log_file="mysql.log"
slow-query-log=1
slow_query_log_file="mysql-slow.log"
long_query_time=10
skip-name-resolve
[[skip-grant-tables]]
log-error="mysql-err.log"
server-id=1
max_connections=151
query_cache_size=0
table_open_cache=2000
tmp_table_size=89M
thread_cache_size=10
myisam_max_sort_file_size=100G
myisam_sort_buffer_size=168M
key_buffer_size=8M
read_buffer_size=64K
read_rnd_buffer_size=256K
sort_buffer_size=256K
#innodb_additional_mem_pool_size=12M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=7M
innodb_buffer_pool_size=556M
innodb_log_file_size=48M
innodb_thread_concurrency=9
innodb_autoextend_increment=64
innodb_buffer_pool_instances=8
innodb_concurrency_tickets=5000
innodb_old_blocks_time=1000
innodb_open_files=300
innodb_stats_on_metadata=0
innodb_file_per_table=1
innodb_checksum_algorithm=0
back_log=80
flush_time=0
join_buffer_size=256K
max_connect_errors=100
open_files_limit=4161
query_cache_type=0
sort_buffer_size=256K
table_definition_cache=1400
binlog_row_event_max_size=8K
sync_master_info=10000
sync_relay_log=10000
sync_relay_log_info=10000
max-allowed-packet=100M
max_allowed_packet=100M