Connecting to a database$link _id = mysql_connect ("localhost", "root", "") or Die ("Connection failed");if ($link _id){Select Databasemysql_select_db ("My_test");The above is the header database Connection section, which is the following common
1, find the MySQL configuration file
/etc/my.cnf
I use the LNMP one-button installation package, MySQL configuration file may not be the same as yours, please find your own.
2, modify the following parameters:
Key_buffer = 16KMax_allowed_packet =
MySQL tutorial log cleanup and MySQL log analysis
SET NOCOUNT onDECLARE @LogicalFileName sysname,@MaxMinutes INT,@NewSize INTUse tablename-the name of the database tutorial to manipulateSelect @LogicalFileName = ' tablename_log ',-log file
MySQL tutorial development must see skillsFirst, the basis1, Description: Create a database tutorialCreate DATABASE Database-name2, Note: Delete the databaseDrop Database dbname3, Description: Backup SQL Server-Device to create backup data
Use
The MySQL tutorial stored procedure is a stored procedure with parameters (Dynamic execution of SQL statements), which queries the user's information based on the conditions and sort criteria entered by the user, and the sorting criteria may not be
MySQL tutorial how to export a database tutorial
This article collects most of the web site about MySQL Export database method, because yesterday a friend sent an e-mail to ask me how MySQL exported the database, the following we summarized a
SELECT * FROM table limit [offset,] rows | Rows Offset Offset
The limit clause can be used to force a SELECT statement to return the specified number of records. Limit accepts one or two numeric parameters. parameter must be an integer constant.
This tutorial is going to tell you about the MySQL tutorial how to improve the table's statistical query speed Oh, we talked about using the middle table to improve the query and statistical speed of the datasheet.
For tables with a large database
A script is used to export all MySQL databases and save them to a specified location.The contents are as follows:
The code is as follows
Copy Code
#!/bin/bash############################################## This is a MySQL
Description
Operating system: CentOS
Objective: To monitor whether the MySQL master-slave database is synchronized, if it is not synchronized, record the failure time, and execute the command to restore the synchronization status.
1. Create
The functionality provided through MySQL
Export
Command:
Mysqldump-u user name-P database > database. sql
Example:
The code is as follows
Copy Code
Mysqldump-u root-p db1 > Db1.sql (Backup of database db1 to Db1.sql)
Method One:
Refer to the method under Windows, move the/var/lib/mysql to the desired directory, modify the/etc/my.cnf file, and specify the data directory. This aspect of the tutorial online a lot, you can go to search.
Shut down MySQL Service
JDBC Basic operations All the following methods and data members are in the public class JDBCOperation.(1) define the record class (optional)This is required to facilitate operations and interface definition.Static class Student {Private String
First, a StringConvert bean (GBtoISO () and ISOtoGB () methods are implemented to solve some Chinese garbled characters during interaction with the MySQL database: read MySQL Chinese content in the JSP program. These two methods can solve the
MySQL driver: mysql-connector-java-3.1.7.tar.gzJ2SE version: 5.02Tomcat version: 5.0.30MySQL: 4.1.10 or 3.23.49 (my version)First, extract the MySQL driver and there is a mysql-connector-java-3.1.7 package under the
The details are as follows:1. I forgot the password. How can I change the root password? Open the cmd window first;2. Run dir to check the directory;3. Switch cd mysql/bin to this directory;4. Enter the current password to report an error;5. mysqld -
First, you need to use PHP to connect to the MySQL database:# Connecting to a databaseThe following is the simplest PHP code for connecting to the MySQL database: The code is as follows:Copy code $ Link = mysql_connect ("localhost", "root",
MySQL master-slave replication is widely used in database backup, failover, data analysis, and other scenarios.MySQL master-slave replication tracks all database changes (updates, deletions, and so on) in binary logs based on the master server ).
Sometimes the database host suddenly loses power or shuts down unexpectedly, the following error occurs when starting the MySQL database:Starting MySQL... ERROR! The server quit without updating PID file (/usr/local/mysql/var/localhost. pid
The VPS operating system is CentOS 6, and the mysql version is 5.5.31 (the REMI source is used ).A. Configure the installation source of MariaDB first.Currently, the main version of MariaDB is MariaDB 5.5.33a Stable. Save the following installation
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