且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MySQL新手,我很困惑!

更新时间:2022-11-16 16:11:14

w_curtis写道:
w_curtis wrote:
我是一名Access用户,我正在尝试学习MySQL,然后是PHP,这样我就可以制作一些网络数据库了。但它只是没有点击。
I''m an Access user, and I''m trying to learn MySQL and then PHP so I can make
some web databases. But it just isn''t clicking.




这是真的,这是因为MySQL是一个真正的数据库,而Access

是只是一个玩具(看起来不错,但你不能用它做很多有用的东西)

恕我直言。


数据库服务器的主要用途是成为一个服务器。然后你可以找到你喜欢与之交互的UI或GUI。有两个控制台

和MySQL的图形插件,但我更喜欢mysql控制台程序。


如果你知道SQL,它很容易与控制台交互程序,

但如果没有,你应该学习它,如果你打算做数据库

软件。你应该学习它,因为在不了解SQL的情况下,很难做出快速有效的查询,这是

网页编程所必需的。


#启动控制台程序:

#(假设你在C:\ Myy \中安装了mysql)

#(假设你有还没设置root密码)

#(如果你有root密码使用:mysql -u root -p)


C:\> cd c:\ mysql \ bin \

c:\ mysql \ bin> mysql -u root

欢迎使用MySQL监视器。命令以;结尾;或者\ g。

您的MySQL连接ID为129到服务器版本:3.23.49-log


键入''help;''或'' \h''寻求帮助。输入''\ c''清除缓冲区。


mysql>


#当你看到这个,你在mysql控制台你可以

#例如创建一个数据库,选择数据库,在那里创建表

#将数据插入表中,并选择数据,

#最后我们将删除数据库,这将破坏表,插入数据和数据库的
#。当然如果你是#b $ b#为现实生活做点什么,你不需要丢弃数据库,

#它只是删除我们的测试数据库。小心不要用这个命令来删除mysql数据库:


mysql> create database mydatabasename;

查询OK,1行受影响(0.01秒)

mysql>使用mydatabasename;

数据库已更改


mysql> create table mytablename(id int unsigned,name varchar(255));

查询OK,0行受影响(0.00秒)

mysql>插入mytablename值(1,''Jack'');

查询OK,1行受影响(0.00秒)

mysql>插入mytablename值(2,''Lisa'');

查询OK,1行受影响(0.00秒)

mysql> select * from mytablename;

+ ------ + ------ +

| id |姓名|

+ ------ + ------ +

| 1 |杰克|

| 2 | Lisa |

+ ------ + ------ +

2行套装(0.01秒)


mysql> drop database mydatabasename;

查询OK,3行受影响(0.00秒)


如果你没有做到这一切,请告诉我们失败的地方,我们请问

看看我们是否可以解决这个问题。


GUI程序是什么,我不太了解它们,因为我不知道t

使用它们。然而,其他人可能会回答这个问题,或者你可以尝试用Google搜索答案。



That is true, and it is because MySQL is a real database, while Access
is just a toy (looks nice, but you can''t do much usefull stuff with it)
IMHO.

The main purpose of a database server is to be a server. Then you can
find the UI or GUI you like to interact with it. There are both console
and graphical intercases for MySQL, but I prefer mysql console program.

If you know SQL it is quite easy to interact with the console program,
but if not, you should learn it, if you are going to do database
software. You should learn it, because without understanding SQL it is
very hard to make fast and efficient queries, which are required in
web-programming.

# To start the console program:
# ( Assuming you have mysql installed in C:\MySQL\ )
# ( Assuming you have not set up the root password yet )
# ( If you have root password use: mysql -u root -p )

C:\> cd c:\mysql\bin\
c:\mysql\bin> mysql -u root

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 129 to server version: 3.23.49-log

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

mysql>

# When you see this, you are in mysql console and you can
# for example create a database, select database, create table there
# insert data into table, and select the data,
# and finally we will drop the database, which will destroy
# the tables, inserted data and database. Of course if you are
# doing something for real life, you don''t need to drop database,
# it is just to remove our test-database. Be carefull not to
# drop mysql database with this command.:

mysql> create database mydatabasename;
Query OK, 1 row affected (0.01 sec)

mysql> use mydatabasename;
Database changed

mysql> create table mytablename( id int unsigned, name varchar(255) );
Query OK, 0 rows affected (0.00 sec)

mysql> insert into mytablename values( 1, ''Jack'' );
Query OK, 1 row affected (0.00 sec)

mysql> insert into mytablename values( 2, ''Lisa'' );
Query OK, 1 row affected (0.00 sec)

mysql> select * from mytablename;
+------+------+
| id | name |
+------+------+
| 1 | Jack |
| 2 | Lisa |
+------+------+
2 rows in set (0.01 sec)

mysql> drop database mydatabasename;
Query OK, 3 rows affected (0.00 sec)

If you fail to do all that, please tell us where it fails and we will
see if we can fix that problem.

What comes to GUI programs, I don''t know much about them, since I don''t
use them. However someone else might answer to that question, or you
could try searching the answer for example with Google.


w_curtis写道:
w_curtis wrote:
我是Access用户,我正在尝试学习MySQL,然后学习PHP,这样我就可以创建一些Web数据库。但它只是没有点击。
I''m an Access user, and I''m trying to learn MySQL and then PHP so I can make
some web databases. But it just isn''t clicking.




这是真的,这是因为MySQL是一个真正的数据库,而Access

是只是一个玩具(看起来不错,但你不能用它做很多有用的东西)

恕我直言。


数据库服务器的主要用途是成为一个服务器。然后你可以找到你喜欢与之交互的UI或GUI。有两个控制台

和MySQL的图形插件,但我更喜欢mysql控制台程序。


如果你知道SQL,它很容易与控制台交互程序,

但如果没有,你应该学习它,如果你打算做数据库

软件。你应该学习它,因为在不了解SQL的情况下,很难做出快速有效的查询,这是

网页编程所必需的。


#启动控制台程序:

#(假设你在C:\ Myy \中安装了mysql)

#(假设你有还没设置root密码)

#(如果你有root密码使用:mysql -u root -p)


C:\> cd c:\ mysql \ bin \

c:\ mysql \ bin> mysql -u root

欢迎使用MySQL监视器。命令以;结尾;或者\ g。

您的MySQL连接ID为129到服务器版本:3.23.49-log


键入''help;''或'' \h''寻求帮助。输入''\ c''清除缓冲区。


mysql>


#当你看到这个,你在mysql控制台你可以

#例如创建一个数据库,选择数据库,在那里创建表

#将数据插入表中,并选择数据,

#最后我们将删除数据库,这将破坏表,插入数据和数据库的
#。当然如果你是#b $ b#为现实生活做点什么,你不需要丢弃数据库,

#它只是删除我们的测试数据库。小心不要用这个命令来删除mysql数据库:


mysql> create database mydatabasename;

查询OK,1行受影响(0.01秒)

mysql>使用mydatabasename;

数据库已更改


mysql> create table mytablename(id int unsigned,name varchar(255));

查询OK,0行受影响(0.00秒)

mysql>插入mytablename值(1,''Jack'');

查询OK,1行受影响(0.00秒)

mysql>插入mytablename值(2,''Lisa'');

查询OK,1行受影响(0.00秒)

mysql> select * from mytablename;

+ ------ + ------ +

| id |姓名|

+ ------ + ------ +

| 1 |杰克|

| 2 | Lisa |

+ ------ + ------ +

2行套装(0.01秒)


mysql> drop database mydatabasename;

查询OK,3行受影响(0.00秒)


如果你没有做到这一切,请告诉我们失败的地方,我们请问

看看我们是否可以解决这个问题。


GUI程序是什么,我不太了解它们,因为我不知道t

使用它们。然而,其他人可能会回答这个问题,或者你可以尝试用Google搜索答案。



That is true, and it is because MySQL is a real database, while Access
is just a toy (looks nice, but you can''t do much usefull stuff with it)
IMHO.

The main purpose of a database server is to be a server. Then you can
find the UI or GUI you like to interact with it. There are both console
and graphical intercases for MySQL, but I prefer mysql console program.

If you know SQL it is quite easy to interact with the console program,
but if not, you should learn it, if you are going to do database
software. You should learn it, because without understanding SQL it is
very hard to make fast and efficient queries, which are required in
web-programming.

# To start the console program:
# ( Assuming you have mysql installed in C:\MySQL\ )
# ( Assuming you have not set up the root password yet )
# ( If you have root password use: mysql -u root -p )

C:\> cd c:\mysql\bin\
c:\mysql\bin> mysql -u root

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 129 to server version: 3.23.49-log

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

mysql>

# When you see this, you are in mysql console and you can
# for example create a database, select database, create table there
# insert data into table, and select the data,
# and finally we will drop the database, which will destroy
# the tables, inserted data and database. Of course if you are
# doing something for real life, you don''t need to drop database,
# it is just to remove our test-database. Be carefull not to
# drop mysql database with this command.:

mysql> create database mydatabasename;
Query OK, 1 row affected (0.01 sec)

mysql> use mydatabasename;
Database changed

mysql> create table mytablename( id int unsigned, name varchar(255) );
Query OK, 0 rows affected (0.00 sec)

mysql> insert into mytablename values( 1, ''Jack'' );
Query OK, 1 row affected (0.00 sec)

mysql> insert into mytablename values( 2, ''Lisa'' );
Query OK, 1 row affected (0.00 sec)

mysql> select * from mytablename;
+------+------+
| id | name |
+------+------+
| 1 | Jack |
| 2 | Lisa |
+------+------+
2 rows in set (0.01 sec)

mysql> drop database mydatabasename;
Query OK, 3 rows affected (0.00 sec)

If you fail to do all that, please tell us where it fails and we will
see if we can fix that problem.

What comes to GUI programs, I don''t know much about them, since I don''t
use them. However someone else might answer to that question, or you
could try searching the answer for example with Google.


w_curtis写道:
w_curtis wrote:
我是Access用户,我正在尝试学习MySQL,然后学习PHP,这样我就可以创建一些Web数据库。但它只是没有点击。
I''m an Access user, and I''m trying to learn MySQL and then PHP so I can make
some web databases. But it just isn''t clicking.




这是真的,这是因为MySQL是一个真正的数据库,而Access

是只是一个玩具(看起来不错,但你不能用它做很多有用的东西)

恕我直言。


数据库服务器的主要用途是成为一个服务器。然后你可以找到你喜欢与之交互的UI或GUI。有两个控制台

和MySQL的图形插件,但我更喜欢mysql控制台程序。


如果你知道SQL,它很容易与控制台交互程序,

但如果没有,你应该学习它,如果你打算做数据库

软件。你应该学习它,因为在不了解SQL的情况下,很难做出快速有效的查询,这是

网页编程所必需的。


#启动控制台程序:

#(假设你在C:\ Myy \中安装了mysql)

#(假设你有还没设置root密码)

#(如果你有root密码使用:mysql -u root -p)


C:\> cd c:\ mysql \ bin \

c:\ mysql \ bin> mysql -u root

欢迎使用MySQL监视器。命令以;结尾;或者\ g。

您的MySQL连接ID为129到服务器版本:3.23.49-log


键入''help;''或'' \h''寻求帮助。输入''\ c''清除缓冲区。


mysql>


#当你看到这个,你在mysql控制台你可以

#例如创建一个数据库,选择数据库,在那里创建表

#将数据插入表中,并选择数据,

#最后我们将删除数据库,这将破坏表,插入数据和数据库的
#。当然如果你是#b $ b#为现实生活做点什么,你不需要丢弃数据库,

#它只是删除我们的测试数据库。小心不要用这个命令来删除mysql数据库:


mysql> create database mydatabasename;

查询OK,1行受影响(0.01秒)

mysql>使用mydatabasename;

数据库已更改


mysql> create table mytablename(id int unsigned,name varchar(255));

查询OK,0行受影响(0.00秒)

mysql>插入mytablename值(1,''Jack'');

查询OK,1行受影响(0.00秒)

mysql>插入mytablename值(2,''Lisa'');

查询OK,1行受影响(0.00秒)

mysql> select * from mytablename;

+ ------ + ------ +

| id |姓名|

+ ------ + ------ +

| 1 |杰克|

| 2 | Lisa |

+ ------ + ------ +

2行套装(0.01秒)


mysql> drop database mydatabasename;

查询OK,3行受影响(0.00秒)


如果你没有做到这一切,请告诉我们失败的地方,我们请问

看看我们是否可以解决这个问题。


GUI程序是什么,我不太了解它们,因为我不知道t

使用它们。然而,其他人可能会回答这个问题,或者你可以尝试用Google搜索答案。



That is true, and it is because MySQL is a real database, while Access
is just a toy (looks nice, but you can''t do much usefull stuff with it)
IMHO.

The main purpose of a database server is to be a server. Then you can
find the UI or GUI you like to interact with it. There are both console
and graphical intercases for MySQL, but I prefer mysql console program.

If you know SQL it is quite easy to interact with the console program,
but if not, you should learn it, if you are going to do database
software. You should learn it, because without understanding SQL it is
very hard to make fast and efficient queries, which are required in
web-programming.

# To start the console program:
# ( Assuming you have mysql installed in C:\MySQL\ )
# ( Assuming you have not set up the root password yet )
# ( If you have root password use: mysql -u root -p )

C:\> cd c:\mysql\bin\
c:\mysql\bin> mysql -u root

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 129 to server version: 3.23.49-log

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

mysql>

# When you see this, you are in mysql console and you can
# for example create a database, select database, create table there
# insert data into table, and select the data,
# and finally we will drop the database, which will destroy
# the tables, inserted data and database. Of course if you are
# doing something for real life, you don''t need to drop database,
# it is just to remove our test-database. Be carefull not to
# drop mysql database with this command.:

mysql> create database mydatabasename;
Query OK, 1 row affected (0.01 sec)

mysql> use mydatabasename;
Database changed

mysql> create table mytablename( id int unsigned, name varchar(255) );
Query OK, 0 rows affected (0.00 sec)

mysql> insert into mytablename values( 1, ''Jack'' );
Query OK, 1 row affected (0.00 sec)

mysql> insert into mytablename values( 2, ''Lisa'' );
Query OK, 1 row affected (0.00 sec)

mysql> select * from mytablename;
+------+------+
| id | name |
+------+------+
| 1 | Jack |
| 2 | Lisa |
+------+------+
2 rows in set (0.01 sec)

mysql> drop database mydatabasename;
Query OK, 3 rows affected (0.00 sec)

If you fail to do all that, please tell us where it fails and we will
see if we can fix that problem.

What comes to GUI programs, I don''t know much about them, since I don''t
use them. However someone else might answer to that question, or you
could try searching the answer for example with Google.