Finally, it is solved by the common method: "Set names CharSet" in Mysql_query. One thing to be particularly aware of is that the setting in PHP uses "UTF8" instead of "Utf-8". That's the problem.
later look at the data found a solution, that is,
Today due to accidental login MySQL server (the MySQL server is equipped with phpMyAdmin) to view the process (show processlist), I went to a large number of unauthorized users to connect to MySQL, the process results are as follows:
1. First in the C disk we create a TXT document renamed it "Mysql-init.txt", the contents of the document we enteredUpdate Mysql.user set Password=password (' newpasswd ') where user= ' root ';
Flush privileges; Note: One of the newpasswd can be
Let's take a look at the following examples:
The code is as follows
Copy Code
TableID Name1 A2 b3 C4 C5 b
The library structure is probably like this, this is just a simple example, the actual situation will be
Error code:1153 Got a packet bigger than ' Max_allowed_packet ' bytes false hints.The beginning did not notice, prompted a large pile, later saw this sentenceWhen you export MySQL data using the SQLyog tool, the export is not wrong when the data is
Char type
The length of the char column is fixed to the length declared when the table was created. The length can be any value from 0 to 255. When you save the char value, fill the space on their right to reach the specified length. When a char
Error tips
Is the Chinese all display garbled
Resolution method
Query MySQL Settingsmysql> s--------------C:Program filesmysqlmysql Server 5.0binmysql.exe Ver 14.12 distrib 5.0.67,For Win32 (IA32)Connection id:1Current Database:commonCurrent User:
To add a user account to the MySQL users table:
Instead of adding a user record directly using the INSERT statement, you can use Insert to appear:
Error 1364 (HY000): Field ' ssl_cipher ' doesn ' t have a default value. However, the earlier MySQL
The steps are as follows (both Windows and Linux platforms apply):
A, client login mysql, enter user name and password
B, set the new maximum number of connections at the MySQL command prompt to 500:mysql> set GLOBAL max_connections=500
C,
Mysqldump Backup command-uroot Root User-p123456 Password is 123456The database where the MyDB table resides MyDBMYTB the table that will be exported MYTB>/opt/mytb.sql Backup to Mytb.sql
Export the entire database
The code is as
The usual method
The code is as follows
Copy Code
SELECT * FROM table group BY column_name ORDER by id DESC
is not able to get the maximum value of the ID within each packet.
Workaround:
Someone writes the
A more practical backup MySQL script is attached below
The code is as follows
Copy Code
##===========================================================# # Db_bak_rman.sh# # Created by Robinson# # 2011/11/07# # Usage:db_bak_
Set DatabaseThe difference between the text or integer fields used in the database and the fields used to save images is that the data volume to be saved is different. The MySQL database uses special fields to store large data volumes. The data type
Program code The code is as follows:Copy code // The database connection will not be written here$ S = isset ($ _ GET ['s '])? $ _ GET ['s']: 0;$ E = isset ($ _ GET ['E'])? $ _ GET ['E']: 50;$ Count = 85000;If ($ s {$ SQL = "select * from table
Recently, I also started playing Linux and instantly felt like I had to go up again. So I installed Ubuntu + Win7 on my laptop. Of course, XAMPP must be installed in Ubuntu. I mean to me.To install XAMPP, download it from the official website. The
The system reports an error when configuring MySQL-Python:EnvironmentError: mysql_config not foundAfter Google, I learned that mysql_config is a MySQL development file, but MySQL installed using apt-get does not have this file, so I searched for it
Install mysql from ubuntu today The code is as follows:Copy code Apt-get install mysql-server Found at startupService mysql startRather than invoking init scripts through/etc/init. d, use the service (8)Utility, e.g. service mysql start Since
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