Novice Road-mysql Installation
Directory structure
- Windows platform
- MySQL Installation
- Sample Data Import
- Linux Platforms
- CentOS System
- Ubuntu system
- FAQ
- Password Generation tool-keepass
- Modify Prompt
- Graphical tools
- Delete Error
MySQL Installation
MySQL Download: 32-bit system download
64-bit system download
Installation process (with 64-bit platform as an example)
- Choosing a Custom Installation
- Modifying the directory where MySQL holds data files C:\Program files\mysql\mysql Server 5.5
- This page is the Enterprise version of the promotion, directly turned off. We only use the free. _
- Start the Database Configuration Wizard
- Select verbose mode
- Select Developer
- Select a multipurpose database
- Specify the location of the InnoDB table space, keeping the default
- Choose a business type, OLTP, online transaction processing
- Specify the service port for MySQL, keep the default of 3306. and recommend the use of strict SQL mode
Sql-mode= "Strict_trans_tables,no_auto_create_user,no_engine_substitution"
The Strict_trans_tables transactional storage engine will check the input data more closely, which will cause MySQL to refuse to accept the vast majority of illegal values
No_auto_create_user A grant statement without the identified by clause will not be able to create a user, preventing the creation of a new user (authorized) without a password.
No_engine_substitution when a table is built or modified, the specified storage engine is unavailable and an error occurs
- Character set settings, select UTF8
- Select the MySQL service name to include the MySQL command path in the environment variable
- Set the root user's password, prohibit the use of simple passwords such as 123456, the recommended use of uppercase and lowercase letters + numbers of mixed passwords, 16-bit length.
It is recommended to use the KeePass tool software generation, the FAQ section is introduced.
Do not create additional anonymous users.
- After execution, MySQL will start automatically, click Finish to complete the configuration
- Open run, use the cmd command. Set the cmd layout first, set the width and height of the buffer to 9999 (maximum), avoid truncation of the preceding output, or cause the formatting to be confusing due to newline.
- Connect to MySQL locally (localhost). Note: Do not write the password in clear text after the-p parameter.
Select User,host,password from Mysql.user;
This command allows you to view the accounts that are currently present in MySQL. The percent sign (%) of the host column, which means that the MySQL database can be connected from anywhere.
Try connecting to MySQL with a local IP address. (IP address view command: ipconfig, see output "Ethernet Adapter" "IPV4 address part")
- Stop/restart MySQL
In the Run window, enter ' services.msc ', open Service Manager, find the MySQL service (MySQL This service name is the 12th step, select the MySQL name). In the upper left corner, there are commands such as "Stop", "restart", and so on.
Sample Data Import
Sample Database http://examples.oreilly.com/9780596007270/
Entity Model Information Http://en.wikipedia.org/wiki/Entity-relationship_model
- Log in to MySQL, create Bank library
CREATE DATABASE IF not EXISTS bank;
- Place the downloaded Learningsqlexample.sql file in the C:\Program files\mysql\mysql Server 5.5 Directory
- Select Bank Library
Use Bank;
- Import the Learningsqlexample.sql data
SOURCE C:\Program files\mysql\mysql Server 5.5\learningsqlexample.sql;
Or
- View the imported data table
PerformSHOW TABLES;
- Attached: Table definition Description
Table name |
definition |
Account |
Specific products that are open to specific customers |
Branch |
A place to conduct bank transactions |
Business |
Company customer (sub-type of Customer table) |
Customer |
A person or company that communicates with a bank |
Department |
Group of employees performing specific banking functions |
Employee |
The staff of the Bank |
Individual |
Individual customer (sub-type of Customer table) |
Officer |
A person who is allowed to initiate a business transaction for a company customer |
Product |
Banking services provided to customers |
Product_type |
Grouping of products with similar functions |
Transaction |
Change the operation of the account balance |
Linux Platforms
Import data, refer to the Windows section.
CentOS System
installation process omitted, refer to compilation/binary/rpm installation documentation
Ubuntu system
Reference http://www.percona.com/doc/percona-server/5.5/installation/apt_repo.html
Attention
- Version represents the release code, and if it is a 12.04LTS version, replace it with precise
- The version installed by Apt-get is the latest version.
- Set the root user password for MySQL
FAQ Password Generation Tool-keepass
Official website http://keepass.info/
Version 2.21 Http://downloads.sourceforge.net/keepass/KeePass-2.21-Setup.exe
Generate Random passwords
- Tools, Password Generator
- Display the generated password list, view the Preview tab, and select a single line.
Modify PromptAdded in the MySQL section of the MY.CNF configuration file
Prompt=\\r:\\m:\\s\_\h:\p\_\\d>
(default) mysql>
(modified) 10:11:36 127.0.0.1:3306 (None) >
More references
Graphical tools
Heidisql
Official Address http://www.heidisql.com/
Delete Error
if exists bank; Error 1010 (HY000): Error dropping database (can ' t rmdir '. \bank\ ', errno:17)
Workaround: Go to the C:\Program files\mysql\mysql Server 5.5\data\bank directory to see if there are other non-database files. Yes, clear.
Download and installation of MySQL