Photoshop Learning Web PHP learning MySQL Courseware advanced article 1th/2 page

Source: Internet
Author: User
Responsibilities of the database administrator
Startup and shutdown of the server
User Account Maintenance
Log file Maintenance
Backup and copy of the database
Optimization of the server
Software updates for database management systems
Security of Data Catalog
Security of the server
Disaster recovery
Preventative Maintenance
``````````````````````````````````````````````````
Startup and shutdown of the database
1, the start of the database:
Method One: Start MySQL with the service command
# service Mysqld Start
Mysqld is the daemon for MySQL and runs it to start the MySQL service.
Method Two: Start MySQL with the mysqld script
#/etc/init.d/mysqld Start
Method Three: Using the Safe_mysqld utility to start the MySQL service, this method can use the relevant parameters
# safe_mysqld&
Use the & symbol to run the safe_mysqld in the background.
```````````````````````````````````````````````````````````
Verify that MySQL is started:
# Service MYSQLD Status
Returns the following information indicating that it has been started
MYSQLD (PID 1663) is running ...
1663 is the mysqld running process number, which may vary depending on the number of processes running on different systems
If you need to restart MySQL, you can use one of the following commands:
# Service Mysqld Restart
#/etc/init.d/mysqld Restart
````````````````````````````````````````````````````````
2, the database shutdown:
You can use one of the following commands:
# Service Mysqld Stop
#/etc/init.d/mysqld Stop
#/mysqladmin Shutdown
MySQL Management
Modify Root admin password
Method One:
Mysql>set password for ' account ' @ ' host ' = Old_password (' password ');
Update mysql.user Set password = old_password (' password ') where host = ' host ' and user = ' account number ';
Flush privileges;
Method Two:
mysqladmin password ' CRQ '
User password
For MySQL passwords you can use the password () and encrypt () functions to encrypt
Mysql>select PASSWORD ("Alex");
"23FC96E064BE0017"
Note: ENCRYPT () is not available on Windows
Method Three: Use the UPDATE statement and the password () function to set the root password to CRP.
mysql> Update user Set Password=password (' Crq ')
where user= ' root ';
Returns the following information indicating that the authorization table user modified successfully
Query OK, 2 row affected (0.09 sec)
Rows matched:2 Changed:2 warnings:0
Note: This method modifies the authorization table user directly, and the server only loads the permission settings in the authorization table at startup, so you must use the flush in the client program MySQL environment The privileges command or the FLUSH-PRIVILEGES subcommand using the Administrative Tools Mysqladmin notifies the server to reload the authorization table.
mysql> flush Privileges; This is now available for use.
```````````````````````````````````````````````````````````````````
Changing the database storage path
Under window, all MySQL databases are saved in the "%mysqlroor%\data" directory.
Stop MySQL Service
Modify the%systemroor%\my.ini file
[Mysqld]
Datadir=d:/data
Move all the files and folder contents in the original directory to the new directory D:/data directory.
Restart MySQL Service
Modifying the MySQL character set
Locate the MySQL configuration file My.ini, generally in C:\window\my.ini.
Add "DEFAULT-CHARACTER-SET=GBK #" or Gb2312,utf8 to the My.ini file
Restart MySQL Service
To delete an anonymous user:
myslq> Delete from user where user= ';
Returns the following information indicating that the anonymous user was removed successfully
Query OK, 2 row affected (0.03 sec)
To add a new user right:
Use the GRANT statement to grant user permissions,
Grammar:
GRANT priv_type[(column_list)][,priv_type[(column_list)] ...]
on {* * * | * | db_name.* | db_name.tabl_name | db_name}
To user_name [identified by ' Password ']
[USER_NAME [Identified by ' password '] ...]
[With GRANT OPTION]
Create a new user
User name, maximum allowable for 16 English characters
Develop databases and tables that allow the user to access
Develop actions that allow the user to do something to the database
Establish which host/IP to allow the user to connect remotely
To allow the user to authorize or cancel the authorization of another user
For example: Add a superuser crq that can connect to the MySQL server from the local host, but must use a password when connecting Crqpass
Mysql> Grant All on *. * to Crq@localhost identfied by ' crqpass ' with GRANT option;
Returns the following information indicating that the permission setting was successful
Query OK, 0 rows affected (0.02 sec)
For example, use the same method to add a superuser who can connect to the MySQL server from anywhere else CRQ, but must use a password when connecting Crqpass
Mysql> Grant All on * * to crq@ '% ' identified by ' Crqpass ' with GRANT option;

Current 1/2 Page 12 next page

The above introduces the Photoshop Learning website PHP learning MySQL Courseware advanced article 1th/2 page, including the Photoshop learning site content, I hope to be interested in PHP tutorial friends helpful.

  • Contact Us

    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

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.