PERL操作程序五十五(Mysql安装设定关联)

返回

C:\Users\shu>netstat -ao | find "3306" TCP 0.0.0.0:3306 shu-PC:0 LISTENING 2044 C:\Users\shu>mysqladmin ping -u root -p Enter password: ******** mysqld is alive G:\database\sql>mysql cookbook -u root -p < dump.txt Enter password: ******** ERROR 1049 (42000): Unknown database 'cookbook' G:\database\sql>mysql -u root -p < dump.txt Enter password: ******** ERROR 1046 (3D000) at line 22: No database selected G:\database\sql>mysql -h localhost -p -u root Enter password: ******** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.1.65-community MySQL Community Server (GPL) Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE DATABASE cookbook; Query OK, 1 row affected (0.00 sec) mysql> exit Bye G:\database\sql>mysql cookbook -u root -p < dump.txt Enter password: ******** G:\database\sql>mysql -h localhost -p -u root Enter password: ******** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.1.65-community MySQL Community Server (GPL) Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> GRANT ALL ON cookbook.* TO 'cbuser'@'localhost' IDENTIFIED BY 'cbpass'; Query OK, 0 rows affected (0.01 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.02 sec) mysql> show columns from owners; +----------+-----------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------+-----------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | company | char(100) | YES | | NULL | | | name1 | char(100) | YES | | NULL | | | address | char(100) | YES | | NULL | | | person | char(50) | YES | | NULL | | | telfax | char(100) | YES | | NULL | | | email | char(100) | YES | | NULL | | | homepage | char(100) | YES | | NULL | | | memo | char(100) | YES | | NULL | | | area | int(11) | YES | | 9 | | | ourref | text | YES | | NULL | | | ship | text | YES | | NULL | | | money | text | YES | | NULL | | +----------+-----------+------+-----+---------+----------------+ 13 rows in set (0.01 sec) ------------------------------------------------------------------ c:\database\sql>mysqldump cookbook > dump.txt mysqldump: Got error: 1045: Access denied for user 'ODBC'@'localhost' (using pas sword: NO) when trying to connect c:\database\sql>mysqldump cookbook -u root -p > dump.txt Enter password: **** 把dump.txt文件复写到windows7的G:\database\sql ------------------------------------------------------------------ mysql-essential-5.1.65-win32.msiインストール Welcome to the MySQL Server Instance Configuration Wizard 1.0.17.0 Detailed Configuration Developer machine Multifunctional Database Port Number:3306, Add firewall exception for this port! Include Bin Directory in Windows PATH! 安装成功! C:\Users\msc>mysql -u root -p Enter password: ******** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.1.65-community MySQL Community Server (GPL) Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | test | +--------------------+ 3 rows in set (0.00 sec) mysql> CREATE USER cbuser; Query OK, 0 rows affected (0.00 sec) mysql> CREATE USER cbuser IDENTIFIED BY [PASSWORD] 'cbpass'; 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 '[PASS WORD] 'cbpass'' at line 1 mysql> delete from user where password=''; ERROR 1046 (3D000): No database selected mysql> use user; ERROR 1049 (42000): Unknown database 'user' mysql> use user ERROR 1049 (42000): Unknown database 'user' mysql> use mysql Database changed mysql> delete from user where password=''; Query OK, 1 row affected (0.00 sec) mysql> CREATE USER cbuser IDENTIFIED BY [PASSWORD] 'cbpass'; 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 '[PASS WORD] 'cbpass'' at line 1 mysql> CREATE USER 'cbuser'@'localhost' IDENTIFIED BY 'cbpass'; Query OK, 0 rows affected (0.00 sec)
Setup Type Developer Default Installation Path: =>C:\Program Files\MySQL\ Data Path: =>C:\ProgramData\MySQL\ Custom MySQL Server ClientPrograms Applications MySQL For Excel 1.0.6 MySQL Connectors(不要) Check Requirements  Visual Studio Tools for Office 2010 Runtime==>Execute Configuration Overview Initial Configuration Development Machine Enable TCP/IP Networking Port Number: 3306 Advanced Configuration Show Advanced Options MySQL Root Password: Repeat Password: Install As Windows Service Service Name: MySQL55 Start the MySQL Server as System Startup Run Windows Service as Standard System Account
返回