MySQL add users, create a new database, user authorization, delete users, modify password (note that each line is followed by the following; Represents the end of a command statement):
1. New User
Login MySQL:@>mysql-u root-p
@> Password
To
1, use case to redefine the numeric type SELECT Id,title,(case date, ' 0000-00-00 ' THEN ' ELSE date end) As DateFrom your_tableSELECT Id,title,(Case status when 0 THEN ' open ' if 1 THEN ' close ' ELSE ' standby ') As StatusFrom your_table 2, find
This article mainly simulates the implementation of master master failure by manually specifying master to from node.
#masterha_master_switch--master_state=dead--conf=/etc/masterha/app1.cnf--dead_master_host=10.1.1.231--dead_ master_ip=10.1.1.231-
There is such a demand1: Class tableID class_name2: Student TableID Name class_idIf we were to check all the classes and the students in each class, you would have thought of that:
The code is as follows
Copy Code
Random Read data
The MySQL Self statement can be implemented, as illustrated below:For example, I want to randomly read 6 of data displayed to the viewer:MySQL statement:
The code is as follows
Copy Code
"SELECT * from
The advantages of MySQL replication mainly include the following 3 aspects:1. If there is a problem with the primary server, you can quickly switch to services provided from the server2. Can perform query operations from the server, reduce the
Error prompts such as:
The code is as follows
Copy Code
$mysql-urootERROR 1040 (00000): Too Many connections
Because I use the MYSQL5 server is Win2000 This method is good to solve, find me MySQL installation
The root causes that affect database performance:
1, disk I/O read
2,CPU Utilization Rate
3, Resource competition
The way to optimize:
1, design optimization
2, Operation optimization
3, using other optimization techniques
1) Design
1. Send Kill command to MYSQLD server to turn off MYSQLD server (not kill-9), and the file that holds the process ID is usually in the directory where the MySQL database resides.
The code is as follows
Copy Code
Use the username and password provided directly in the [client] section of the/etc/mysql/debian.cnf file:
The code is as follows
Copy Code
# mysql-udebian-sys-maint-pEnter Password: mysql> UPDATE user SET
Crack local Password:Windows:1. Login system with system administrator.2. Stop the MySQL service.3. Enter the command window, and then enter the MySQL installation directory, such as my installation directory is c:mysql, into the C:mysqlbin4. Skip
CMD switch to MySQL installation directoryCasesD:/mysql/binPrerequisite: The MySQL user root password is empty.Enter Mysql-u root MySQLIn mysql> state enter update user set Password=password (' New password ') where user= ' root ';EchoQuery OK, 0
1. Install the latest version of Ubuntu Server and update the system.
2. Install the MySQL server:sudo apt-get instal mysql-server, then set the administrator password and remove the local address bindings so that remote access can be made.
Main: 1
Using software:mysqlmigrationtool
Tip the data is too large to import. Modify the my.cnf file Max_allowed_packet = above 100M. In the Windows operating system, MY.CNF may not appear, need to use the editor to enter the address directly: Disk
Yesterday we talked about the MySQL tutorial stored procedure creation modification and deletion, this tutorial is about the definition assignment of variables in MySQL stored procedure Oh.
definition of a variable
Define a variable syntax as
The difference between char and varchar in the MySQL tutorial is used to store strings, except that they are stored in a different way, Char has a fixed length, and varchar is a variable-length character type.
The difference between char and
MySQL tutorial is different from most database tutorials, there is a storage engine in MySQL, for different needs, users can choose the most suitable for their own storage engine, then there are many types of storage engine MySQL, and their
Step 1: find the driverMySQL currently provides the java driver Connection/J, can be downloaded from the MySQL official website, and find the mysql-connector-java-3.0.15-ga-bin.jar file, this driver is pure java driver, do not need to do other
In CentOS 7, yum list mysql * is used. There is no MySQL version that can be installed. In CentOS 7, the default database is MariaDB. For MariaDB, it is a branch of MySQL, the acquisition of MySQL by Oracle has the risk of closing the source, so
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