For children who want to engage in or love mysql-related work, it is necessary to implement some simple operations on mysql under the command line. This article describes how to log on to the mysql database
For children who want to engage in or love
TRIGGER Syntax: CREATETRIGGER & lt; Trigger name & gt; -- the trigger must have a name up to 64 characters, which may be followed by a separator. it is similar to the naming of other objects in MySQL. {BEFORE | AFTER} -- Trigger has execution time
Show all databases: Show databases;
Create Database customer; customer is the database name;
Open Database: Use customer; open the database before you perform various operations;
Customer table ID number name gender age birth date salary phone
This program can be used to browse MySQL data. you can make some modifications to make a good MySQL browser .*//*? Analytic DB? Cmdtabledb {}? Cmdrecorddb {} table {} */$ hostlocalhost; $ usertest; $ password; if (! Isset ($ cmd) $ MongoDB; switch ($
SELECT DISTINCT a.name from table A ORDER by (select SUM (num) as num from table where name=a.name) desc
A table table,name field is duplicated, and the NUM field is a number: Displays the name that is not duplicated, and then the same name as Num
This article mainly introduces php simple operations on mysql databases, and involves php operations on mysql connection, query, insert, delete, and other basic operation methods, which are very useful, for more information about how to use php to
The simple method for optimizing the configuration of MySQL server bitsCN.com has a growing website access volume, and MySQL naturally becomes a bottleneck. Therefore, I have been studying MySQL optimization recently, the first step naturally comes
Note that this article is not a principle, but a simple summary. If you have any questions, pay attention to the following two sites:
Http: // I
MySQL . CN/
Http://dev.mysql.com/doc/refman/5.1/zh/index.html
1. Modify RootUserPasswordBy default,
1. Enter the Database Password root through the command line2. Create my database mydatabaseCreate Database mydatabase;3. Create a table userinf under the database mydatabaseFirst use mydatabase;Create Table userinf (user_id int primary key,
Install and configure MySQL.
MySQL CRUD (add, delete, modify, and query)
List all databases
show databases;
Create a database
-- Create database mydb1 using MySQL Default Configuration; -- create database mydb2
The principle and script are both very simple, that is, whether the Slave_IO_Running and Slave_ SQL _Running values in the synchronization state are both Yes. If not, send a text message to the police.
[Root @ mysqlb script] # cat
How to get better full-text search results in MySQL
Author: Techrepublic.com.com
11:14:53
Many Internet applications provide full-text search functions. Users can use a word or word segment as a query item to locate matching records. In the
1. Installation: MySQL installation packages are divided into the installation version and the green decompression version. The green unzipping version does not require installation. You can decompress it directly and use it in the doscommand line.
DOS command to enter MySQLC:/> mysql-H 127.0.0.1-u root-PEnter Password> ***********Mysql> complete
Create Database databasename;
Perform operations using the specified database:
Method 1: Use Database databasename;Method 2: mysql> databsename;
This
Program It can be used to browse Mysql Data. You can make some modifications to make a good MySQL browser.
*/
/*? Cmd = DB? Cmd = TABLE & DB = {}? Cmd = Record & dB ={}& table = {}*/
$ Host = 'localhost ';$ User = 'test ';$ Password = '';
#!/bin/bash #this is a script of MySQL backup if [!-d/mydata/data1/backup]; then mkdir/mydata/data1/backup fi CD
/mydata/data1/backup file=$ (find.-type f-mtime-7 | grep. *all.sql) #查找7天内是否有备份的文件 echo $file if [-Z $file]; then echo "Backup all
This program can be used to browse the data in MySQL, you can do a little modification can make a good MySQL browser.
*/
/*
? cmd=db
? cmd=table&db={}
? cmd=record&db={}&table={}
*/
$host = ' localhost ';
$user = ' Test ';
$password = ';
if
Master configuration:Code to copy code as followsLog-bin = Mysql-binServer-id = 1Binlog-do-db = Powerdns #要同步的数据库Master new Slave Account:Code to copy code as followsmysql> GRANT replication Slave on * * to ' slave ' @ ' 192.168.1.2 ' identified by '
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.