MYSQL ±¸Íü¼
MySQL client programs:
mysql
The command-line tool for interactively entering SQL statements or executing them from a file in batch mode. See Section 4.5.1, “mysql — The MySQL Command-Line Tool”.
mysqladmin
A client that performs administrative operations, such as creating or dropping databases, reloading the grant tables, flushing tables to disk, and reopening log files. mysqladmin can also be used to retrieve version, process, and status information from the server. See Section 4.5.2, “mysqladmin — Client for Administering a MySQL Server”.
mysqlcheck
A table-maintenance client that checks, repairs, analyzes, and optimizes tables. See Section 4.5.3, “mysqlcheck — A Table Maintenance and Repair Program”.
mysqldump
A client that dumps a MySQL database into a file as SQL, text, or XML. See Section 4.5.4, “mysqldump — A Database Backup Program”.
mysqlimport
A client that imports text files into their respective tables using LOAD DATA INFILE. See Section 4.5.5, “mysqlimport — A Data Import Program”.
mysqlshow
A client that displays information about databases, tables, columns, and indexes. See Section 4.5.6, “mysqlshow — Display Database, Table, and Column Information”.
mysqlslap
A client that is designed to emulate client load for a MySQL server and report the timing of each stage. It works as if multiple clients are accessing the server. See Section 4.5.7, “mysqlslap — Load Emulation Client”.
Ïà¹ØÎĵµ£º
Ö÷´ÓģʽµÄÌØÐÔ¾ÍÊÇһ̨·þÎñÆ÷×÷ΪÖ÷·þÎñÆ÷£¬ÆäÓà·þÎñÆ÷×÷Ϊ´Ó·þÎñÆ÷£¬Ö÷·þÎñÆ÷½ÓÊÕÔöɾ¸Ä²éµÄ²Ù×÷£¬´Ó·þÎñÆ÷Ö»ÄܽÓÊÕ²éµÄ²Ù×÷¡£
Ö÷·þÎñÆ÷½«Êý¾Ý¸üÐÂÖÁ´Ó·þÎñÆ÷ÊÇÒì²½µÄ£¬Òì²½µÄÓŵãÊÇ¿ÉÒÔÔÚ·þÎñÆ÷¿ÕÏÐÆÚ¼ä½øÐÐͬ²½£¬¶ø²»±ØÕ¼ÓýôȱµÄ×ÊÔ´£¬È±µã¾ÍÊÇ´Ó·þÎñÆ÷µÄÊý¾ÝºÜ¿ÉÄܲ»ÊÇ×îеġ£
Ö»ÄÜÓ¦ÓÃÓÚ¶ÔÊý¾Ýͬ²½ÒªÇ󲻸ߵij¡ºÏ ......
Ò»¡¢ ·ÖÇøµÄ¸ÅÄî
¶þ¡¢ ΪʲôʹÓ÷ÖÇø£¿£¨Óŵ㣩
Èý¡¢ ·ÖÇøÀàÐÍ
ËÄ¡¢ ×Ó·ÖÇø
Îå¡¢ ¶Ô·ÖÇø½øÐÐÐ޸ģ¨Ôö¼Ó¡¢É¾³ý¡¢·Ö½â¡¢ ......
Ò»¡¢³£ÓÃ×Ö·û´®º¯Êý
1.CONCAT(str1,str2,...)
mysql> ? concat;
mysql> SELECT CONCAT('My', 'S', 'QL');
+-------------------------+
| CONCAT('My', 'S', 'QL') |
+-------------------------+
| MySQL ......
×î½üÁ˽âÁËÒ»ÏÂMYSQL×¢È룬Ҳʵ¼Ê²Ù×÷ÁËһϣ¬È·Êµ·¢ÏÖÁËËûµÄÍþÁ¦¡£
Ò»¸ö×¢Èë©¶´¿ÉÒÔÈÃÈËÖ±½ÓÄõ½·þÎñÆ÷ȨÏÞ¡£
×ܽáһϣº
1£¬Ä¿Â¼µÄȨÏÞ²»ÄÜÌ«¸ß£¬²»È»±ðÈËÄÜÍùÀïдÎļþ£¬ÒÔǰÓÃ0777ÕæÊÇÌ«ÓÞ´ÀÁË¡£
2£¬Ñϸñ¹ýÂËÊý¾Ý£¬ÕûÐÎÒ»ÂÉתint»òÓÃmysql_escape_string
3£¬ÉèÖúÏÀíµÄÊý¾Ý¿âȨÏÞ£¬²»ÒªÓÃROOT,²»È»»áËÀµÃºÜ²Ò¡£
4 ......
´Ó±¾Æª²©ÎÄ¿ªÊ¼£¬ÎÒÃǾÍÒªÉîÈëµ½PHPµÄÓ¦Óõ±ÖÐÈ¥ÁË¡£PHPµÄÊý¾Ý¿âÓ¦ÓÃÊÇÖØÖÐÖ®ÖØ£¬±ØÐëÕÆÎÕ¡£Ñ¡ÔñʲôÑùµÄÊý¾Ý¿âÄØ£¬µ±È»ÊÇÎÒÃǵÄMySQLÀ²£¬Ã»ÓÐÈË»áȥʹÓÃÄÇЩÅÓ´ó¡¢µÍЧ¶øÓÖ°º¹óµÄÉÌÒµÊý¾Ý¿âÀ´¹¹½¨PHPÓ¦Óðɡ£
1 MySQLÊý¾Ý¿âµÄ°²×°
¹ýÈ¥£¬°²×°Ò»¸öMySQLÊý¾Ý¿â²¢ÇÒÒªÆô¶¯ÆðÀ´ºÜ·ÑÊ£¬ÌرðÊÇÔÚLinuxÕâÑùµÄ¿ª·¢»·¾³Ï£¬ÐèÒª¸ ......