Mysql command line import. SQL data to the database
1. First open the mysql tutorial in the command line ConsolePerhaps the command is as follows:Mysql-u root-p database_nameThen you may be prompted to enter the corresponding Password2. The
Full MySQL command line parameters
The mysql tutorial supports the following options:
--- Help ,-?Displays the help message and exits.
-- Batch,-BPrint the result and use tab as the column delimiter. Each row occupies a new row. With this option,
Create index to create an index. Let's take a look at the syntax.
Create index index_nameON table_name (column_name)
Create a unique index SQL syntax IndexCreate a unique index seat. Duplicate values are not allowed: Create unique index
I want to get started with all the languages I want to learn. mysql is also the same as it is with basic syntax and data types. Let's take a look at the simple mysql tutorial.MySQL syntax The great thing you do in MySQL is that the "code" is easy to
SQL INNER JOIN keyword usage tutorial
When the keyword of inner join is returned, at least one row in the competition is returned.SQL Syntax of INNER JOIN
SELECT column_name(s)FROM table_name1INNER JOIN table_name2 ON
SQL SELECT INTO tutorial
The SQL SELECT INTO statement can be used to create a backup copy table.In the SQL SELECT INTO statementIn the select into statement, SELECT data from a table and insert it to a different table.The select into statement is
Change the mysql password, mysql change the root password, how to change the mysql password, mysql change the User Password
First, we need to declare that, in most cases, modifying MySQL requires the root permission in mysql. Therefore, users cannot
Mysql directly uses limit for paging operations. If we do not add any processing, the data may be too big, and it will be very difficult, next I will introduce the mysql paging instance and paging performance optimization.
1. The most common paging
In mysql, group by group queries are often used and used together with having. The following describes the precautions for using group by and having, I hope this tutorial will be helpful to all of you.
The use of the group by function should be that
Use commands to create a MySQL databaseHttp://www.sudu.cn/service/detail.php? Id = 11443 # 6d
Zero, MYSQL Process Control
Mysql:Show variables like 'Port ';Show variables like "have _ % ";Windows:Http://www.jz123.cn/text/3035482.htmlNet stop
1. Mysql
Net start mysql [
Net stop mysql [
Quit [
\ C [
Select version (), current_date ()
Mysql
Now ()
User () User
Select sin (pi ()/6), 100/3;
Prompt
Description
Mysql>
Ready to accept new commands
->
For 255 to 65535 members, two bytes are required for storage. Up to 65535 members are allowed.Create a data table with Enumeration type using SQL statements.
The Code is as follows:
Create table user_sex (sex enum ('M', 'F '));
Write several pieces
Preface:
I installed MYSQL in LINUX and changed the empty ROOT password when I first installed it. At that time, I also changed a memorable password. I did not expect to forget it in an hour, so I took notes on the password recovery process.
Because
1. MySQL Common commands
Create database name; create a database
Use databasename; select database
Drop database name directly deletes the database, no reminder
Show tables; displays tables
Describe tablename; Detailed description of the table
Add
In web development, we often write some SQL statements. A bad SQL statement may make your entire program very slow. After 10 seconds, users usually choose to close the webpage, how to optimize SQL statements to find out SQL statements that have been
The following is an example of high CPU usage by MYSQL. I hope I will be inspired by my friends who have encountered similar problems. In general, MYQL occupies a high CPU usage, most of which is caused by database query code problems. Too many
Troubleshooting of data tables:
1. When you access the webpage, an error is displayed, indicating that the database cannot be connected.
2. Start the mysql service and uninstall and disable the mysql service installed by rpm.(Install postfix
1. Local backupCompile an automatic backup script:Vim/var/lib/mysql/autobakThe content is as follows:Copy codeThe Code is as follows:Cd/data/home/mysqlbakRq = 'date + % Y % m % d'/Usr/local/mysql/bin/mysqldump sqldb -- flush-logs-uroot-p123456 --
Modify the MySQL password:Copy codeThe Code is as follows:Mysqladmin-u root-p password 123456Mysqladmin-u username-p old password New password
Forget the MySQL password:Copy codeThe Code is as follows:Chown-R mysql: mysql/var/lib/mysql/Etc/init.
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