Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mysql start and stop and basic use, garbled handling

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1) You can use the decompression version to decompress directly: for example, mysql-5.7.9-linux-glibc 2.5-x86_64.tar.gz

2)Put the prepared my.cnf (this file can be copied from my_default.cnf in the support-files directory under mysql directory, and then add some parameters to it) into the mysql decompression directory

My.cnf is specifically:

#For advice on how to change settings please see

#http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html

# DO NOT EDIT THIS FILE. It's a template which will be copied to the

# default location during install, and will be replaced if you

#*** upgrade to a newer version of MySQL.

[mysqld]

character-set-server=utf8

collation-server=utf8_general_ci

Remove leading # and set to the amount of RAM for the most important data

#cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.

innodb_buffer_pool_size = 128M

skip-host-cache

skip-name-resolve

lower_case_table_names=1

#Remove leading # to turn on a very important data integrity option: logging

changes to the binary log between backups.

#log_bin

#These are commonly set, remove the # and set as required.

basedir =/home/bes/webgate/mysql-5.7.9-linux-glibc2.5-x86_64

datadir =/home/bes/webgate/mysql-5.7.9-linux-glibc2.5-x86_64/data

socket=/home/bes/webgate/mysql-5.7.9-linux-glibc2.5-x86_64/mysql.sock

port =3306

#server_id =

Remove leading # to set options mainly useful for reporting servers.

The server defaults are faster for transactions and fast SELECTs.

Adjust sizes as needed, experiment to find the optimal values.

joinbuffersize = 128M

sortbuffersize = 2M

readrndbuffersize = 2M**

max_connections=1000

max_allowed_packet=1073741824

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

innodb_locks_unsafe_for_binlog=1innodb_print_all_deadlocks=1

log-error=/home/bes/webgate/mysql-5.7.9-linux-glibc2.5-x86_64/error.err

You can modify the installation directory

3) Initialize the data and generate a root@localhost account with an empty passwordbr/>innodb_print_all_deadlocks=1

log-error=/home/bes/webgate/mysql-5.7.9-linux-glibc2.5-x86_64/error.err

You can modify the installation directory

3) Initialize the data, it will generate a root@localhost account, the password is empty

The data directory appears below the directory; the service is not started

4)bin/mysqld --defaults-file=${MYSQl_NAME}/my.cnf Start Service

5)Then use the command to change the username password

bin/mysqladmin -uroot password'123456' --socket=mysql.sock

6)will log in with the command

bin/mysql --socket=./ mysql.sock -uroot -p'123456'

Normal access is possible

7) Database backup

bin/mysqldump -uroot -p123456 -h292.168.0.70 Webgate >./ backup.sql

Reduction:

bin/mysqldump -uroot -p123456 -h292.168.0.70 Webgate

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report