Locahost cannot connect to the MySQL database.
Problem: a server's PHP program cannot connect to the database through the localhost address, but if set to 127.0.0.1 you can connect normally, and connecting to other database servers is normal. MySQL
The integer types in the MySQL data type is a bit odd. You may see int data types such as int (3), int (4), int (8). When I first contacted MySQL, I thought that int (3) occupies less storage space than int (4), and int (4) occupies less storage
1. When mysql-h 127.0.0.1, using TCP/IP connectivity, MySQL server considers the connection to be from 127.0.0.1 or "Localhost.localdomain"
2. When mysql-h localhost, it is not connected with TCP/IP and uses UNIX sockets; At this time, MySQL server
If you specify on DUPLICATE key UPDATE and the insert row causes duplicate values to occur in a unique index or primary key, the
Row old row update. For example, if column A is defined as unique and contains a value of 1, the following two
The MySQL order BY keyword is used to classify the data in the record.
MySQL ORDER BY keyword classified by keyword
The ORDER BY keyword is used to classify the data in a record.
MySQL ORDER BY syntax
The code is as follows
Copy
In general, the log first reflects the application of the current problem, in the mass log found in our abnormal records, and then recorded, and according to the situation alarm, we can monitor the system log, Nginx, Apache, business log. Here I
Linux MySQL Tutorial change character set encoding and Ubuntu under change MySQL default encoding
Find configuration file/etc/mysql/my.cnfUnder [client], addDefault-character-set=utf8Add under [mysqld]Default-character-set=utf8Reboot the
Mainly introduces the commonly used MySQL commands, including the connection database, the modification password, manages the user, the operation database, the Operation data table, the database backup and so on, each order has the example
It is important to back up your database if your database tables are missing or corrupted. If a system crash occurs, you will want to be able to recover as few data from your table as possible to the state at which the crash occurred. Sometimes it
Linux has a significant feature that, under normal circumstances, you can analyze the log to see what is happening in your system or what is happening. Indeed, system logs are the first-hand resources that system administrators need most to solve
How to download:
I'll go to MySQL first. Download the latest version of mysql-Link: https://www.mysql.com/downloads/
Enter this interface to download:
Downloads–>mysql Community Edition (GPL) (This is free edition, of course, the rich can be
There are only a few minor problems that I have encountered during my use:
HTTP error 403.1– prohibit access: execution access denied
The reason is that there are insufficient execution permissions, and the solution is:
Workaround One:
Open the
Test the PHP file
$link =mysql_connect (' localhost ', ' root ', ' zz ') or Die (Mysql_error ());
mysql_select_db (' test ') or Die (' no db ');
mysql_query (' SET NAMES utf8 ');
Echo 99;
?>
Error after run
Can ' t connect to the local MySQL server
For some VPS, the system defaults to install MySQL. We need to uninstall (remove) The default MySQL from our server, VPS. So how (how) to uninstall MySQL on the Ubuntu\debian?
Typically, the following MySQL packages are installed in Debian, Ubuntu:
Inserting data into the MySQL table requires that you use the SQL INSERT INTO command. You can insert data into the MySQL table using the mysql> prompt or use any script, such as PHP.Syntax:
The following is a generic SQL syntax insert INTO command
Brief introduction:Mysqlbinlog Flashback function is a very strong work of Taobao Peng Lixun (http://www.penglixun.com/).Main function: The Binlog in the rows format can be operated in reverse. Delete reverse generates INSERT, Update generates
To see if the event Scheduler is currently open, you can perform the following sql:
Show VARIABLES like ' Event_scheduler ';Or
SELECT @ @event_scheduler;Or
Show Processlist;If the display:
+-----------------+-------+| variable_name | Value |+----
The MySQL preparation statement (Prepared statements), which uses enhanced binary client/server protocols to efficiently send data between the client and server, enables access to prepared statements through a programming library that supports such
26. How to know the MySQL to solve a query
Run the Item column command and try to figure out its output:
Show VARIABLES;
Show COLUMNS from ... G
EXPLAIN SELECT ... G
FLUSH STATUS;
SELECT ...;
Show STATUS;
27, MySQL is very good
Log
When
After MySql is newly installed, the root account prompts mysql ERROR 1045 (28000): Access denied for use. The solution is 28000 denied.
After MySQL is newly installed, it is executed for the first time.mysql -uroot -pThe root password is not empty.
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