Peeking in mysql5.0 alpha enterprise functional

zhaozj2021-02-16  53

Peeking in mysql 5.0 Enterprise Functional

© by Dennis 2004.01

MySQL5.0 alpha released, we look forward to the "Detailed information, please refer to the news of the official website of MySQL AB. Early desired function, don't try it yet. ...

This article uses Windows XP Pro OS as an example <:) I don't intend to promote M $, but I use Windows, there is no way to explain, other OS classes, download mysql5.0 first, in order to avoid installation, We download the version of the WITHOUT Installer (Unzip In C: /) directly, to http://www.mysql.com/downloads/mysql-5.0.html download.

1. Put it directly to C: / under, and change the root directory to mysql (not changed, then in my.ini to change the mysql to your actual name)

2. The following is the configuration file of My.ini. If you are not familiar with the configuration, you can directly COPY in the past is My.ini to put it in C: / Windows Next (my computer RAM = 256) === ============================================================================================================================================================================================================= ============================================================================================================================================================================================================= = # Esample mysql config file. # Copy this file to c: /my.cnf to set global options # one can use all long options That The program supports. # Run the program with --help to get a list of available option Options

# This will be passed to all mysql clients [client] # password = my_password port = 3306 # Socket = mysql

# Here is entries for some specific proGrams # the folowing value assume you have at Least 32M Ram

# The MySQL server [mysqld] port = 3306 # socket = MySQL skip-locking set-variable = key_buffer = 16M set-variable = max_allowed_packet = 1M set-variable = table_cache = 64 set-variable = sort_buffer = 512K set-variable = net_buffer_length = 8k set-variable = myisam_sort_buffer_size = 8m Server-id = 1 # uncomment the following if you want to log updates # log-bin

# Uncomment the folowing rows if you move the mysql distribution to another # location #basedir = D: / mysql / #dataDir = D: / mysql / data /

# Uncomment the folowing if you are not using bdb Tables # Skip-BDB

# Uncomment the following if you are use bdb Tables # set-variable = bdb_cache_size = 4m # set-variable = bdb_max_lock = 10000

# Uncomment the following if you are using Innobase tables innodb_data_file_path = ibdata1: 400M innodb_data_home_dir = C: / mysql / InnoDB / ibdata # InnoDB and ibdata folders you want to do it yourself innodb_log_group_home_dir = C: / mysql / InnoDB / iblogs # iblogs information clip Also you have to do it yourself innodb_log_arch_dir = C: / mysql / innodb / iblogs set-variable = innodb_mirrored_log_groups = 1 set-variable = innodb_log_files_in_group = 3 set-variable = innodb_log_file_size = 5M set-variable = innodb_log_buffer_size = 8M innodb_flush_log_at_trx_commit = 1 innodb_log_archive = 0 set-variable = innodb_buffer_pool_size = 16M set-variable = innodb_additional_mem_pool_size = 2M set-variable = innodb_file_io_threads = 4 set-variable = innodb_lock_wait_timeout = 50

[mysqldump] Quick set-variable = max_allowed_packet = 16m

[mysql] no-auto-rehash # Remove the next comment character if you are not familia with sql # Safe-Updates

[Isamchk] set-variable = key_buffer = 20M set-variable = sort_buffer = 20M set-variable = read_buffer = 2M set-variable = write_buffer = 2M [myisamchk] set-variable = key_buffer = 20M set-variable = sort_buffer = 20M set- Variable = read_buffer = 2m set-variable = write_buffer = 2m

[mysqlhotcopy] interactive-timeout [winMysqladmin] server = c: /mysql/bin/mysqld-nt.exe ============================ ================================================================================★

3. CREATE INNODB TABLE TABLE SPACE If there is no problem, you should see the following: ============================== ============================

C: / mysql / bin> MySQLD - Console Innodb: The first specified data file c: / ibdata1 Didb / IBDATA / IBDATA1 DID NOTAST: IBDATA1 DID NOTAST: INNODB: A New Database to Be Created! 040113 15:12:54 InnoDB: Setting File C: / IBData1 Size to 400 MB InnoDB: Database Physical Writes The File Full: Wait ... InnoDB: Progress in MB: 100 200 300 400 040113 15:13:19 InnoDB: log file C: / mysql / InnoDB / iblogs / ib_logfile0 did not exist: new to be created InnoDB: Setting log file C: / mysql / InnoDB / iblogs / ib_logfile0 size to 5 MB InnoDB: Database physically writes the file full: wait ... 040113 15 : 13: 19 InnoDB: log file C: / mysql / InnoDB / iblogs / ib_logfile1 did not exist: new to be created InnoDB: Setting log file C: / mysql / InnoDB / iblogs / ib_logfile1 size to 5 MB InnoDB: Database physically writes The File Full: Wait ... 040113 15:13:20 InnoDB: log file c: / mysql / innodeb / iblogs / ib_logfile2 Did NOT: New to be created InnoDB: setting log file c: / mysql / innodb / iblogs / IB_Logfile2 Size to 5 MB InnoDB: Database Physical ly writes the file full: wait ... InnoDB: Doublewrite buffer not found: creating new InnoDB: Doublewrite buffer created InnoDB: Creating foreign key constraint system tables InnoDB: Foreign key constraint system tables created 040113 15:13:26 InnoDB: Started; Log sequence number 0 0 mysqld: Ready for Connections. Version: '5.0.0-alpha-max-debug' socket: '' port: 3306 ==================== ========================================

Install OK, go in and see, I didn't expect to come to Mysql, I came to Ma Wei immediately. The original '' this user couldn't use mysql's Databases ================== ============================================== c: / mysql / bin> mysql Welcome to the mysql Monitor. Commands end with; or / g. Your mysql connection ID is 2 to server version: 5.0.0-alpha-max-debugtype 'help;' or '/ h' for help. Type '/ c' to clear the buffer .

MySQL> Use mysql error 1044 (42000): Access Denied for user: '' @ 'localhost' to database 'mysql ========================= ==========================================================================================================================================================

There is no way, only ROOT is used in:

============================================================================================================================================================================================================= =========

C: / mysql / bin> mysql -u root -p Enter Password: Welcome to the mysql monitor. Commands end with; or / g. Your mysql connection ID is 5 to Server Version: 5.0.0-alpha-max-debug

Type 'help;' or '/ h' for help. Type '/ c' to clear the buffer.

MySQL>

============================================================================================================================================================================================================= =========) The password of the root is still changed at all.

4. Experience the Create Function

Create Function Myfunc (S Char (20)) Returns Char (50) Return Concat ('Hello', S, 'DLL', '!');

============================================================================================================================================================================================================= ======== mysql> Create Function Myfunc (s char (20)) Returns char (50) Return Concat ('Hello', S, '. LAN', '!'); Query Ok, 0 ROWS Affected (0.00 sec)

MySQL>

MySQL> SELECT MyFunc ('Dennis'); ------------------ | MyFunc ('Dennis') | --------- ----------- | Hello Dennis.lan! | ------------------ 1 ROW IN Set (0.01 sec)

MySQL>

============================================================================================================================================================================================================= ======== 5. DROP FUNCTION

============================================================================================================================================================================================================= ======== mysql> Drop function myfunc; query ok, 0 rows affected (0.00 sec) mysql>

============================================================================================================================================================================================================= =========

6. CREATE A procedure try it!

Create Procedure MyProc (OUT Param1 Int) Begin Select Count (*) INTO Param1 from Sys_Forms;

Millions remember, don't do this below, I tried N times, every time it is wrong, I thought MYSQL had a problem, it was not

============================================================================================================================================================================================================= =========

Mysql> Use test; database change myproc (out param1 int) Begin select count (*) INTO param 1 from sys_forms;

ERROR 1064 (42000): You have an error in your SQL syntax Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELE CT COUNT (*) INTO param1 FROM sys_forms' at line 1.

============================================================================================================================================================================================================= ======== Correct approach is: ===================================== ===================== mysql> Delimiter | # Because your procedure or function is difficult to use ";" as the end of SQL Statement, still please You change this end symbol, or you will appear above Error 1064 (42000)

MySQL> CREATE Procedure MyProc (out param1 int) Begin select count (*) INTO param1 from mysql.user; end; -> | query ok, 0 rows affected (0.00 sec)

============================================================================================================================================================================================================= =========

OK, have you succeeded?

I strongly recommend that you look at this http://www.mysql.com/doc/en/create_procedure.html

Procedure Create is successful, test it! Step 1: ====================================== ==================== mysql> call myproc (@a) | query ok, 0 rows affected (0.01 sec) =========== =============================================== STEP 2: ============================================================================================================================================================================================================= ======== mysql> select @A; -> | ------ | @a | ------ | 0 | ------ 1 ROW IN set (0.00 sec)

MySQL>

============================================================================================================================================================================================================= ======== come complete:

============================================================================================================================================================================================================= ======== mysql> create procedure myproc (out param1 int) Begin select count (*) INTO param 1 from mysql.user; end; -> | query ok, 0 rows affected (0.00 sec) mysql> Call MyProc (@A) | Query OK, 0 ROWS Affected (0.03 sec)

MySQL> SELECT @A | ------ | @A | ------ | 4 | ---- 1 Row in Set (0.00 sec)

============================================================================================================================================================================================================= ======== 7. Drop Procedures: How is this happening?

============================================================================================================================================================================================================= ======== mysql> Drop Procedure myproc; -> | error 1289 (42000): Procedure myproc does not exist

============================================================================================================================================================================================================= =========

It turns out that the mysql under Windows is distinguished by the Question of Procedure. The following is true!

============================================================================================================================================================================================================= ======== mysql> Drop Procedure MyProc | query OK, 0 ROWS Affected (0.00 sec)

============================================================================================================================================================================================================= =========

Note: If you appear when you are connected with your app

Client Does Not Support Authentication Protocol Requested by Server; Consider Upgrading MySQL Client

Please refer to http://www.mysql.com/doc/en/old_client.html provides a detailed solution.

Enjoy it yourself! Good luck!

转载请注明原文地址:https://www.9cbs.com/read-24986.html

New Post(0)