Start: net start mySql;
Enter: mysql-u root-p/mysql-h localhost-u root-p databaseName;
List databases: show databases;
Select Database: use databaseName;
List tables: show tables;
Show columns from tableName;
Create a database: source
In linux, it is often the case that VBB is used in a forum system such as slow, mysql is suspended, and there are too many sleep processes. As a result, the system was completed for dozens of users.In fact, this is the problem of mysql configuration,
In practical work, regular database backup is extremely important. When using MySQL, we have a lot of options for database backup. This article will introduce you to how to use MySQL mysqldump to back up the database.
I. Importance of Data Backup
At
MySQL can be said to be the most widely used database for programmers. I will share some common knowledge about MySQL database development and the selection of storage engines, design and use of indexes and optimization of SQL statements when a
Recently, I used the django framework for web development in MacOS, So I installed MySQL5 with MacPorts. However, during the test, the django test framework reports an error because UTF8 data cannot be inserted.
We know that the default encoding for
Extract data from MySQL today. After using ROLLUP statistics, add the project name to the left column of the data and use SQLSQL codeSELECT (case when isnull (PLAYERNO) then playerno = total else playerno end) as playerno, SUM (AMOUNT) FROM
The table_cache parameter sets the table cache quantity. Each connection will open at least one table cache. Therefore, the size of table_cache should be related to the settings of max_connections. For example, for 200 concurrent connections, the
The project needs to dynamically generate random numbers with fixed digits, such as 8-bit and 5-bit.
The method we saw earlier is as follows:
ROUND (RAND (), 5) * 100000)
This is not accurate, and there is a probability that four digits will occur.
Project Environment:All systems are cent OS 5.5Master Server IP Address: 192.168.19.172 (master)Slave Server IP: 192.168.19.168 (slave)Both of them have set up mysql (the root user and password are empty)1: Set synchronization master and modify the
MySQL Data Synchronization, in the official MySQL website documentation, is called Replication literally meaning, is synchronized. In fact, MySQL synchronization does not use the word "sync", but instead uses replication again, which accurately
1. Copy the table structure and data, but do not copy the index and foreign key:Create table a select * from B;2. Copy the table structure, index, and foreign key without copying data:Create table a like B;3. Copy data only:Insert into a select *
When installing MySQL today, the following error is reported when the./configure command is executed because the package selected by default is not installed in the initial Linux:./Configure -- prefix =/usr/local/mysql -- with-charset = utf8 -- with-
Problem description:The log update updata on the slave locks the table with the select table from the web request, causing synchronization congestion.The load of mysql slave is soaring, and the website anti-problem is very slow.
Problem Analysis:
1.1 backup
Mysqldump adopts an SQL-level backup mechanism. It imports data tables into SQL script files and is suitable for upgrading between different MySQL versions. This is also the most common backup method.
Here are some main parameters of
To connect to MySQL in a LAN, you must first enable the remote connection function for MySQL. On the MySQL server, run the following command on the MySQL command line:
SQL code
Grant all privileges on *. * to root @ "%" identified by '000000'
The mysql configuration file on the server is only for reference and record.
# MySQL Server Instance Configuration File
#----------------------------------------------------------------------
# Generated by the MySQL Server Instance
1. Create a stored procedure
1. Basic Syntax:
Create procedure sp_name ()
Begin
.........
End
Ii. Call the Stored Procedure
1. Basic Syntax:
Call sp_name ()
Note: The stored procedure must be enclosed in parentheses, even if the stored procedure is
Install mysql// Upload mysql-5.0.221.tar.gz to this path:/mnt/disk1/program and installTar-xzvf mysql-5.0.221.tar.gzCd mysql-5.0.22# Creating a folderMkdir/mnt/disk1/program/mysql# Create a group/etc vi groupGroupadd mysql# Create a user/home under
When I checked the brophp framework today, I conveniently reviewed the combined query in mysql. (In the past, I would use the simplest "select * from..."). Others do not dare to use them as much as they do. I am cleaning out the "blind spots" in the
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.