One, method one
1) into the Var/lib/mysql
2 delete mysql file
3 Restart MySQL, to this password has been cleared
4) set a new password
echo "Grant all" *.* to ' root ' @ ' localhost ' identified by ' newpass '; Mysql-urootecho "Grant all" *.*
If there is a problem with the datasheet, you can use the--recover--quick parameter to do the work of patching:
Linux#myisamchk--recover--quick Tbl_name
Linux#isamchk--recover--quick Tbl_name
If the above method does not resolve the problem, you can
Whether in a small, free database space or a large e-commerce site, a reasonable design of the table structure, the full use of space is very necessary. This requires us to have a good understanding of the common data types of database systems.
The code is as follows
Copy Code
Categories Directory tree $globals ["id"] = 1; The ID number used to track the Drop-down menu$layer = 1; The series used to track the current menuConnecting to a database$con =mysql_connect
Author: Wang Mei (HeartIcy@163.com)
The loss of the password is very distressing things, especially the root password lost: (. Install yourself
Play lost also lost, but in the event of a production server hanging trouble can be big!
Now assume that
Later discovered Find_in_set this magical function, for example: There is a Type field in the article table, he stores the article type, has 1 headlines, 2 recommendations, 3 hotspots, 4 text ... 11,12,13, etc.Now he has an article that is both a
The common Backup tool is the mysqldump with MySQL,
The code is as follows
Copy Code
Mysqldump-u root-p Password dbname >d:\test.sql------------back up a libraryMysqldump-u root-p Password dbname tablename>d:\test.sql----
has been using TORNDB and sqlalchemy, this time I pay attention to the next mysqldb, I feel that if you know more about T-SQL, or with mysqldb more flexible, and very simple, isn't it? All of its operations are done with one execute () method.
When using MySQL, there is usually a self increasing ID field in the table, but when we want to empty the data in the table to add data again, we want the ID to start counting back from 1, in the following two ways:
The usual way to set up a
1, write the shell script used by the backup database
The code is as follows
Copy Code
vim/home/mysqlback.sh#!/bin/bashMysql_user=rootMysql_pass=rootDatabase=testFile_name= $DATABASE. ' Date +%y%m%d '.
First, install MySQL. This should not be said much.
Then confirm that My.ini,linux is my.cnf. There is no skip-networking in the document, or the sentence is annotated. Now it seems to be installed after the default is not. (if modified, restart
General database search are used SQL like statements, like statements can not use the index, each query is from the first traversal to the last one, query efficiency is extremely low. With general data above 100,000 or too many online, like queries
Create a userCreate a user named Mysqlusr, set a random password, the length of the password is the bestDo not have less than 20 digits.
2. Set the user's identityAdd MYSQLUSR users to the Guests group and remove any other groups.
3. Set disk
Under Windows:
Open the Command Line window to stop the MySQL service:
The code is as follows
Copy Code
Net stop MySQL
Start MySQL, general to MySQL installation path, find Mysqld-nt.exe (or
Here are some of the information found on the Internet, save it for backup.
1, create an indexIndexing is especially important for queries as a major application. Most of the time the performance problem is simply because we forgot to add the index,
We talked about the view created in the front, today this tutorial we will talk about the MySQL tutorial view changes and updates.
View Modifications .
Grammar:
Alter [Algorithm ={undefined |merge | temptable}] View view_name [(collist)] as
MySQL tutorial massive data paging optimization codePage represents page numberPageSize represents the number of displays per pageConditon represents some conditions view sourceprint?1 select * FROM table where Conditon order by ID limit (page-1)
/* Table structure for storing posts ------------------------------------------------------Create table bbsrow (Bbsrow_id int (6) not null auto_increment, // ID of the subscriberBbsrow_auth varchar (20) not null, // Post authorBbsrow_parentid int (6)
Field type1. INT [(M)]Normal size integer type2. DOUBLE [(M, D)] [ZEROFILL]Normal size (double precision) floating point numeric type3. DATEDate type. The supported range is '2017-01-01 'to '2017-12-31 '. MySQL displays the DATE value in 'yyyy-MM-DD
System: centos 5.9 64-bitSoftware: libiconv-1.14.tar.gz mysql-5.5.25a.tar.gz required1. Preparations before installation2. Install libiconv The code is as follows:Copy code 1./configure -- prefix =/usr/local/libiconv2 make & make install 3.
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.