Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to prepare the work of mysql database

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

I don't know if you have any knowledge about the previous articles on how to prepare the mysql database. Today, I'm here to tell you a little bit about it. If you are interested, let's take a look at the text. I'm sure you'll get something after reading how to prepare the mysql database.

1. Start / stop the mysql database service

Command line mode: (administrator required)

Start the database: net start mysql

Shut down the database: net start mysql

Service Mode: control Panel > Administrative tools > Services > mysql > start / stop

2. Log in / out of the mysql system

Login: mysql-h CVM address-u login [- P port number]-p

Exit: quit; or exit;-- means that you have logged in (entered) mysql.

Note: after logging in to the database system, you need to use the "set names code name;" to set the "environment code name" of the current connection to the database, that is, the encoding of the "client" that is currently dealing with the database. Generally speaking: there is a fixed gbk encoding in the cmd client, while in the php web page, it is the encoding of the web page file (now the mainstream is utf8).

3. Backup and recovery of database:

Backup: is to completely convert a database into a file that can be carried and transferred at any time.

Mysqldump-h CVM address-u login name-p database name > file name

Restore: that is, a backup database file is completely restored to a usable database.

Mysql-h CVM address-u login name-p database name < file name

Note:

Both commands are used when "not logging in to mysql".

The mysqldump command is also required as an administrator.

In general, recovery refers to the recovery of all table data and other information in the original database, and the database name can be the original name or the new name.

The basic grammar provides for comments:

Single-line comments: # comment content

Single-line comment:-comment content (Note:-followed by a space)

Multiline comments: / * comment content * /

Sentence line:

By default, it ends with an English semicolon as a statement! Moreover, in regular operations, "one statement at a time" is executed.

In mysql, you can artificially set the statement Terminator as follows: delimiter the new Terminator, after this line, you can use the new Terminator:

Case problem

The mysql language itself is case-insensitive

Some command execution of mysql generates files (folders), and they may be case-sensitive:

2.1: in systems where file (folder) names are case-sensitive, these names are also case-sensitive, such as unix,linux systems

2.2: in systems where file (folder) names are not case-sensitive, they are also case-insensitive, such as window systems.

Naming problem

Names that can be named themselves are called identifiers, including: database name, table name, field name, view name, function name, procedure name, variable name, user name, and so on.

You can name identifiers with more characters than regular languages, but only alphanumeric characters and underscores are recommended, not starting with numbers.

Unconventional characters or system keywords can be used as identifiers, but they are best enclosed in backquotes (the reverse prime to the left of number 1) and are not recommended.

Database names, table names, and view names are not case-sensitive in window systems, but in other systems, it is recommended to use all lowercase and underscore segmentation.

Other self-named identifiers (field name, function name, procedure name) are not case-sensitive, but it is also recommended to use all lowercase and underscore segmentation.

After reading this article on how to prepare the mysql database, what do you think? If you want to know more about it, you can continue to follow our industry information section.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report