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
MySQL database common commands summary 1. first determine whether the database/table exists, and then create a database/table
CREATE DATABASE IF NOT EXISTS database_name;CREATE TABLE IF NOT EXISTS table_name;
2. modify the table name in MySQL.
Mysqldump is a command code of mysql. It is often used to back up databases or data tables. Next we will introduce the usage of mysqldump.
Mysqldump is a command code of mysql. It is often used to back up databases or data tables. Next we will
Secrets 1. MySQL common command createdatabasename; Create Database usedatabasename; select database dropdatabasename to delete database directly, no reminder
Http://news.newhua.com/news1/program_database/2009/217/0921715343537K7H7IDI2CCI
Viewing MySQL databases is one of our most common operations. The following describes frequently used commands for viewing MySQL Databases in detail. If you are interested in viewing MySQL databases, take a look.
Go to MySQL Command line clientView
Common mysql database commands1. Database authorization
Go to the mysql database: mysql> use mysql; set a new password for the root user: mysql> update user set password = password ("new password") where user = "root "; refresh the database mysql>
1. export Database: mysqldump Command 1. export data and table structure: mysqldump-u username-p password database name sqlusrlocalmysqlbinmysqldump-uroot-pabcabcsql. after you press enter, you will be prompted to enter the password.
1. export the
Getlasterror command
When writing data to a database, MongoDB does not wait for a response message by default. Use the getlasterror command to ensure that the operation has been correctly executed.
In many drivers, the getlasterror command is
Compact command
V1.9 +
The compression command compresses and removes fragments from a set. Indexes are also rebuilt and compressed. This releases space for other collections in the database. It is similar in concept to repairDatabase, but it only
1. Use the mysqldump command to export the database (note the installation path of MySQL, that is, the path of this command ):1. Export data and table structure:Mysqldump-u username-P Password Database Name> database name.
We discussed the database performance optimization on the other hand, that is, the use of database server built-in tools to analyze and optimize.
▲show
Perform the following command to understand the running state of the server: MySQL >show status;
DB2 databaseIt is a distributed database solution of IBM. It has a high technical level and plays an important role in the database industry. This article outlines six methods to execute DB2 commands.
Environment product: DB2 UDB
Platform: z/OS
In daily work, mysql is used simply, so the Common commands are summarized as follows:Use of the mysqldump command:Back up and export DatabasesMysqldump-h database_ip-u Username-p -- opt databasename> backup-file. SQLExport only the database table
If you are used to using windows databases, that is, operating databases on the graphic interface, you will feel unfamiliar when you operate mysql on commands. In fact, as long as you have mastered some basic commands, there are also frequent use,
In daily work, mysql is used simply, so the Common commands are summarized as follows:
Use the mysqldump command:
Back up and export Databases
Mysqldump-h database_ip-u Username-p -- opt databasename> backup-file. SQL
Export only the database table
Next we will discuss another aspect of database performance optimization, that is, using the built-in tools of the database server to assist in performance analysis and optimization.▲ShowRun the following command to check the running status of the
I. Installation
1: During installation, you can choose to create a database, which will naturally create a database.2: If the Oracle software has been installed but the database has not been created, you can use this tool to create a graphical
1. -- Data Operations
Select -- retrieve data rows and columns from database tables
Select * from Table order by OID desclimit; last 5 records in the table
Insert -- add new data rows to the database table
Delete -- delete data rows from a database
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.