B1 中級 其他腔 1095 分類 收藏
hi guys welcome to this tutorial and in this tutorial we will focus on
how to insert data into the table we created last time
so I have already
browsed through to the folder where my MySQL application is present
so now i have to connect to my MySQL server so I will do mysql
-u username (i.e. root)
-p password (i.e. no password)
-h hostname (i.e. or localhost)
I don't have a password so I will just press Enter
It says you are connected to MySQL
if in your case it is showing that
some error has occured then
just go ahead and open up u'r XAMPP control panel
and check here if the MySQL server is running. If it's not running then click on start.
So, in the last tutorial we created a database named userlogin. Inside that
databse we created a table called
user and inside that table we inserted some parameters
4 parameters actually
id, username, password and email. So, in this tutorial we will just insert
data into that table
So, first of all I will do a show databases.
show databases;
There it is
Now again I will
write use userlogin;
and then show tables;
So, there is just one table. Now describe
So, here it is. 4 parameters are present id, username, password and email.
and these are the characteristics of those parameters. And in this tutorial we will just
insert data into those fields.
So lets start by writing Insert
our table name is user
and I will start the paranthesis here
We don't have to insert the value of ID because, it is set to auto-increment. So it
will automatically increase. We will just have to insert the value of
and email
just press Enter here and here I will write my values.
So, our username is a Varchar of 25 chars. So for varchar you
have to use single quotes
Remember that you have to use only single quotes because double quotes won't work
for MySQL. Suppose my username is 'primetuber'
my password will be
and suppose my email-ID is
Now I will close my paranthesis here
end those statements and press enter.
it says query Ok and 1 rows affected.Now we have inserted values into our table
and we can see those values by typing in
So, here it is
ID = 1, username = primetuber, password =12345
and email = abc123@hotmail.com. Now I will
another set of data into this table. So I will write INSERT
our table name is user
and id, I don't have to enter
So, username
then password
and email
i don't have to press Enter. I can just write values
and I will start with username
suppose username is java
password is
and email-ID is javac@gmail.com
we will end the paranthesis
add semicolon and press Enter
It says query OK. 1 row affected. Now to see all the data present in the
table I will write
FROM user
and add semicolon and press Enter.
so here it is. When ID is 1 username is primetuber password is 12345 and email is this
When ID is 2 username is java password is javanet and email is this
So, this is for this tutorial and in the next tutorial
We will talk about more about updating a database and Selecting from databases.
so thank you for my video and if u like the video don't forget to subscribe


MySQL初學者培訓課程 - 2 - 新增資料到資料庫中的資料表 (MySQL Tutorial for Beginners - 2 - Adding Data to Tables in a Database)

1095 分類 收藏
陳柏霖 發佈於 2015 年 2 月 13 日
  1. 1. 單字查詢


  2. 2. 單句重複播放


  3. 3. 使用快速鍵


  4. 4. 關閉語言字幕


  5. 5. 內嵌播放器


  6. 6. 展開播放器


  1. 英文聽力測驗


  1. 點擊展開筆記本讓你看的更舒服

  1. UrbanDictionary 俚語字典整合查詢。一般字典查詢不到你滿意的解譯,不妨使用「俚語字典」,或許會讓你有滿意的答案喔