In the MySQL import Export data often appear the problem of Chinese garbled, mostly because the class import export encoding settings inconsistent. This paper introduces the method of coding conversion under different platforms for reference.
In
It is often found that developers look up the statements that are not indexed or limit N, these no statements will have a significant impact on the database, such as a large table of tens of millions of records to scan all, or do not stop doing
Sometimes when you build a station because the database and the site in different IP, this time need to use the program MySQL remote connection, and MySQL because of security factors, the default time users set is not remote connection, only local
MySQL inserts the data that is queried in table A into table B
If Table B exists
1
insert into a b select * from a;
If Table B does not exist
1
create table B as select * FROM a;
Extended:
Environment: mysql5.5.20 version under Win7
1, in the DOS command line CD to the MySQL bin directory
Start: Mysqld.exe--console
Then the server starts and the information is printed as follows:
130104 17:07:49 innodb:waiting for the background
Org.gjt.mm.mysql.Driver is the predecessor of Com.mysql.jdbc.Driver, if your project uses Org.gjt.mm.mysql.Driver drive, just for compatibility. It's no different from using Com.mysql.jdbc.Driver.
But now the project suggests using
First set up the MySQL master server:
To create a user from the server on the primary server:
1.grant replication Slave on *.* to 192.168.0.1 identified by ' 1234 ';
#4.1 with this, before you can use file.
#grant file on *.* to 192.168.0.1
Master configuration:
The code is as follows
Log-bin = Mysql-binServer-id = 1Binlog-do-db = Powerdns #要同步的数据库
Master new Slave Account:
The code is as follows
mysql> GRANT
1, the MySQL database does not have an incremental backup mechanism, when the amount of data is too large backup is a big problem. Fortunately, the MySQL database provides a master-slave backup mechanism, which is to write all the data in the
MySQL database backup and database import methods:
You cannot execute the following command by using the command prompt to enter the bin directory in the MySQL installation directory before doing so.
1. Backup Database
Mysqldump-u root-p Database
Recently, on Linux to export data with mysqldump, put on the Windows system import will appear in Chinese garbled, and then will lead to the appearance: Unknown MySQL Server host and can ' t connect to the server error.
To resolve MySQL import and
Below is my encapsulated good connection MySQL database class, direct call can.
Microsoft's Visual Studio does not have its own driver to connect to MySQL, to download a mysql-connector-net-6.4.3 driver on the Internet, and then install it to
How MySQL updates database fields tutorial
Grammar
UPDATE table_name SET column_name = new_value WHERE column_name = some_value
Note: SQL is not sensitive to case. Update is equivalent to update.
In order for PHP to execute the above statement,
View current connection system parameters: Show VARIABLES like '%char% '; mysql> Show variables like ' char% '; +--------------------------+---------------- | variable_name | Value +--------------------------+---------------- |
If the direct use of the green version of MySQL, download after decompression, just the directory of the My.ini file Basedir (the basic directory of MySQL) and datadir (MySQL data directory) specified can be, as shown below.
#Path to installation
Problem status
Restart MySQL is also a failure, look at the errorlog of MySQL, you can only see the following information similar to:
Forcing close of thread 12232 User: ' Root '
With mysqladmin simple monitoring of the next MySQL situation:
Note: The content of this article involves modifying NTFS disk permissions and setting security policies, and make sure that you understand the possible consequences of the operation before you make any changes. The permissions mentioned in the
Linux environment, after the installation of MySQL, you can not start the service directly, you must first initialize the database. The main tasks of initialization include:
Initialization of the log, table space and other databases must
For 255 to 65,535 members, 2 bytes of storage are required. Up to 65,535 members are allowed.A data table with enumerated types is created first through the SQL statement.
The code is as follows
CREATE TABLE User_sex (Sex enum (' M ', ' F '));
1, close the MySQL database you are currently running, either by ending the MySQL process or by directly shutting down the MySQL server
2, close the database, run click to start running, enter cmd into the command Line
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