MySQL Stored procedure creation syntax
The code is as follows
Copy Code
CREATE PROCEDURE and create FUNCTION CREATE PROCEDURE sp_name ([proc_parameter[,...]]) [Characteristic ...] Routine_body CREATE FUNCTION sp_name
The code is as follows
Copy Code
Class connectionmysql{HostPrivate $host = "localhost";Username of the databasePrivate $name = "root";Password of the databasePrivate $pass = "";Database namePrivate $table = "phptest";Encoded
Php
int value:Time (): is the number of seconds to return from the Unix era (GMT January 1, 1970 00:00:00) to the current period.We want to obtain the number of seconds from January 1, 1970 to 2012-2-10 can be achieved by strtotime (): namely:
Before you look at this article, make sure you've mastered some of PHP's knowledge and the basics of MySQL's query operation.
As a Web program, you often have to deal with countless numbers of data, for example, members of the data, the article data,
The MySQL master and slave function was set up on CentOS 6.5, and recorded.
Server 1 (primary)ip:192.168.1.201System version: CentOS 6.5MySQL version: MySQL 5.5
Server 2 (from)ip:192.168.1.202System version: CentOS 6.5MySQL version: MySQL 5.5
The
MySQL supports a large number of column types, which can be grouped into 3 categories: numeric types, date and time types, and string (character) types. This section first gives an overview of the available types, summarizes the storage requirements
The code is as follows
Copy Code
Update ' table_name ' SET ' field_name ' = replace (' Field_name ', ' from_str ', ' to_str ') Where ' field_name ' like '%from_str% '
Description
table_name--the name of the tablefield_name-
Solve the problem of garbled web pages, defined in the program query
The code is as follows
Copy Code
db = MySQL _connect ("localhost", "User", "password");mysql_select_db ("message", $db);mysql_query ("SET NAMES ' UTF8 '
Building a table: the process of declaring a column
The code is as follows
Copy Code
CREATE TABLE Table name (Column name 1 column 2 Type column 1 parameter,Column Name 2 column 2 Type column 2
Compare with mysqldump:
1, the former is a fast file in the sense of copy, the latter is a database-side SQL statement collection.2, the former can only run in the database directory on the machine, the latter may be used in remote clients, but the
If you forget the MySQL root password, you can reset it in the following ways:
1. Kill off the MySQL process in the system;
2. Use the following command to start MySQL, to do not check the permissions of the way to start;
Failed to create TABLE #1005Failed to create DATABASE #1006Failed to create database #1007 database already existsFailed to delete database #1008 database does not exist#1009 Unable to delete database file causes database failure to be deleted#1010
The My.ini in the MySQL directory, and then copies a my.ini on the colleague's machine to modify it and put it in a separate place as a backup. The contents are as follows:
The code is as follows
Copy Code
One: (Stop running MySQL)
The code is as follows
Copy Code
[Root@netdakvps ~]# service mysqld Stop
Two: Restart MySQL using the "--skip-grant-tables" parameter
The code is as follows
Copy Code
Click the "SQL" tab on the top to enter the SQL command input interface. Enter the following command:Update mysql. user set password = PASSWORD ('snsgou $123456 ') where user = 'root ';Note: If you have changed the root password, you also need to
Problem background I went to work on Monday. I first asked my colleagues about the test results last week. I was told that MySQL Server hang can't be tested in multi-instance scenarios,The native version does not have this problem, but this problem
If you need to partially replace the content in mysql, you can refer to the following article.Replace Welcom to in the subject field of the cdb_pms table with welcomeUPDATE 'cdb _ pms 'set' subobject' = REPLACE ('subobject', 'Welcome to ', 'Welcome
What MySQL users can execute. The system administrator of the MySQL server or computer can perform additional optimization measures. For example, some server parameters are attached to the query processing process and can be adjusted, and some
I. Optimizing MySQL during compilationIf you distribute and install MySQL from the source code, note that the compilation process will have an important impact on the future target program. Different compilation methods may obtain similar target
$ Hostname = "localhost"; // defines the name of the connected mysql server$ Username = "root"; // defines the user name used for connection.$ Password = ""; // defines the password used for connection.$ Link = mysql_connect ($ hostname, $ username,
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