"MySQL" Mac environment using Navicat Premium connection MySQL garbled problem

Source: Internet
Author: User
Tags unique id

---restore content starts---

The most important two points: use Navicat premium to create a MySQL connection and to create a database in the MySQL connection, you need to be aware of.

1. When creating a connection, the encoding does not need to be manually selected to keep auto on.

2. When you use this connection to create a new database, the default encoding is also maintained.

Note that two points, if garbled, it is possible that the MySQL itself is caused by the code, can be set by the following actions.

1.

In the MAC environment, after the installation of MySQL,/etc path is no my.cnf file, we need to manually add.

Locate the MySQL installation directory, locate the Support-files folder at the bottom, copy the my-default.cnf inside, go to the desktop, and modify its name to MY.CNF. (Note: The version after mysql-5.7.17 does not seem to have my-default.cnf)

and modify the contents to the following content:

# Example MySQL config file for medium systems.
#
# This was 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.
# can copy this option file to one of those
# locations. For information on these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# in the This file, you can use the all long options, which a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options would be passed to all MySQL clients
[Client]
#password = Your_password
Port = 3306
Socket =/tmp/mysql.sock

# here follows entries for some specific programs

# The MySQL server
[Mysqld]
Port = 3306
Socket =/tmp/mysql.sock
Skip-external-locking
Key_buffer_size = 16M
Max_allowed_packet = 1M
Table_open_cache = 64
Sort_buffer_size = 512K
Net_buffer_length = 8K
Read_buffer_size = 256K
Read_rnd_buffer_size = 512K
Myisam_sort_buffer_size = 8M
Character-set-server=utf8
init_connect= ' SET NAMES UTF8 '

# Don ' t listen on a TCP/IP port at all. This can is a security enhancement,
# If all processes this need to connect to mysqld run on the same host.
# All interaction with Mysqld must is made via Unix sockets or named pipes.
# Note that the using this option without enabling named Pipes on Windows
# (via the "enable-named-pipe" option) would render mysqld useless!
#
#skip-networking

# Replication Master Server (default)
# Binary logging is required for replication
Log-bin=mysql-bin

# Binary Logging format-mixed recommended
Binlog_format=mixed

# required Unique ID between 1 and 2^32-1
# defaults to 1 if master-host are not set
# but would not function as a master if omitted
Server-id = 1

# Replication Slave (Comment out master sections to use this)
#
# To configure the host as a replication slave, you can choose between
# methods:
#
# 1) Use the Change MASTER to command (fully described in our manual)-
# The syntax is:
#
# change MASTER to Master_host=# master_user=<user>, master_password=<password>;
#
# where you replace the # <port> 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 the 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 would create a master.info file, and any later
# change in this file to the variables ' values below'll 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 this reason, 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 would not function as a slave if omitted
#server-id = 2
#
# The replication master for this slave-required
#master-host = #
# The username the slave would use for authentication when connecting
# to the master-required
#master-user = <username>
#
# The password the slave would authenticate with when connecting to
# The Master-required
#master-password = <password>
#
# The Port the master is listening on.
# Optional-defaults to 3306
#master-port = <port>
#
# binary Logging-not required for slaves, but recommended
#log-bin=mysql-bin

# Uncomment the following if you is using InnoDB tables
#innodb_data_home_dir =/usr/local/mysql/data
#innodb_data_file_path = Ibdata1:10m:autoextend
#innodb_log_group_home_dir =/usr/local/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% 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

[Mysqldump]
Quick
Max_allowed_packet = 16M

[MySQL]
No-auto-rehash
# Remove The next comment character if you is not a familiar with SQL
#safe-updates
Default-character-set=utf8

[Myisamchk]
Key_buffer_size = 20M
Sort_buffer_size = 20M
Read_buffer = 2M
Write_buffer = 2M

[Mysqlhotcopy]
Interactive-timeout

Then copy it to/etc and restart the MySQL service.

"MySQL" Mac environment using Navicat Premium connection MySQL garbled problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.