In fact, there is a difference between the two. last_insert_id () can return the ID of the bigint value. However, mysql_insert_id returns Int. If you
The ID of is unsigned Int or bigint. The returned result may be incorrect. Instead of
Use PHP to implement XML backup MySQL database favorites
The following is a file used to back up a MySQL database through Apache + PHP in Linux.
Code :
File 1. listtable. php (the file lists all tables in the database for backup) Select the table
CopyCodeThe Code is as follows: Mysql_connect ("localhost", "root", "1981427") // connect to the server on localhost. The username is root.
?>
Copy codeThe Code is as follows: @ Mysql_connect ("localhost", "root", "1981427 ")
Or die ("database
1. Design Principles1) standardization and standardization
Data Standardization helps eliminate data redundancy in databases. There are several forms of standardization, but third Normal Form (3nf) is generally considered to have achieved the best
I. Software Download Go to the MySQL official website to download the following two tools: mysql-5.1.32-win32.msi, mysql-gui-tools-5.0-r17-win32.msi
The former is the MySQL installation file, and the latter is the MySQL tool installation file,
1. Download MySQL
Http://www.mysql.org/downloads What I download is mysql-noinstall-5.0.67-win32.zip.
Ii. Installation Process1. Extract
Mysql-noinstall-5.0.67-win32.zip
To a drive C, rename it
Mysql5
.Assume thatMysql_home = c :\
Using mysql_pwd is insecure. See connection to MySQL server in MySQL 6.3.
"MySQL" uses the file named in the environment variable mysql_histfile to save the command line history. The default value of the historical file is "$ home /.
1. Stop running MYSQL:/etc/init. d/MySQL stop
2. Use the skip-grant-tables option to start MYSQL:/usr/bin/mysqld_safe -- skip-grant-tables &
3. Now you can enter MySQL without a password.
# Myql
> Use MySQL;
> Update user SET Password =
The following uses phpmyadmin-2.6.1.tar.gz as an example.
Decompress phpmyadmin-2.6.1.tar.gz to/usr/local/apache2/htdocs,
Get the folder phpMyAdmin-2.6.1 and rename it to phpMyAdmin (which will be easier in future ).
Go to the phpMyAdmin folder
MySQL allows you to specify multiple statements for execution in a single query string by specifying parameters for the link:
CopyCode The Code is as follows: // set when linking
Mysql_real_connect (..., client_multi_statements );
// Or
// Specify
Mysql> select something from tbl_name
Where to_days (now ()-to_days (date_col)
Dayofweek (date)Returns the week index of date (1 = Sunday, 2 = Monday,... 7 = Saturday ). The index value complies with ODBC standards.Mysql> select dayofweek ('2017-
Three solutions:
1. Change the table method. It may be that your account is not allowed to log on remotely, but only on localhost. At this time, you only need to log in to MySQL on the computer of localhost, and change the "host" entry in the
The solution is as follows:
1. Delete the mysql service first.
Control Panel-> Administrative Tools-> services, stop the mysql service first
Start-> Run-> Enter cmd-> SC delete mysql
Delete Service
2. modify my. iniIf it is not created (refer to
I have written an external module extension. Now I am looking at the mysql extension in the PHP source code. It can be integrated into PHP, so it should be a built-in extension.This extension requires some interfaces provided by the mysql database.
1. select the most suitable field attribute
MySQL can support access to large data volumes, but generally, the smaller the table in the database, the faster the query will be executed on it. Therefore, when creating a table, we can set the field
When an slave server is connected to the master server, it notifies the master server of the last successful update location read from the server in the log. The slave server receives any updates from that time, blocks them, and waits for the master
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