Difference between revisions of "Netbeans/C3/Connecting-to-a-MySQL-Database/Gujarati"
From Script | Spoken-Tutorial
Jyotisolanki (Talk | contribs) |
Jyotisolanki (Talk | contribs) |
||
Line 207: | Line 207: | ||
|- | |- | ||
| 04.36 | | 04.36 | ||
− | | | + | | સૌપ્રથમ એ વાતની ખાતરી કરી લો કે '''MySQL''' ડેટાબેઝ આપણી મશીન પર ચાલી રહ્યું છે કે. |
|- | |- | ||
| 04.42 | | 04.42 | ||
− | | | + | | સર્વિસ વિન્ડોમાંની '''MySQL''' સર્વર નોડ, '''MySQL''' ડેટાબેઝ જોડાણ થયું છે કે નહી તે દર્શાવે છે. |
|- | |- | ||
− | |||
| 04.52 | | 04.52 | ||
− | + | | એ વાતની ખાતરી કરીને કે તે રન થઇ રહ્યું છે, '''Databases''' (ડેટાબેસીઝ) >> '''MySQL server node''' (માયએસકયુએલ સર્વર નોડ) પર જમણું-ક્લિક કરો અને '''Connect''' (કનેક્ટ) પસંદ કરો. | |
− | | | + | |
|- | |- | ||
− | |||
| 05.05 | | 05.05 | ||
− | + | | જેમ વિસ્તૃત કરીએ છીએ, તેમ '''MySQL''' સર્વર નોડ તમામ ઉપલબ્ધ '''MySQL''' ડેટાબેઝો દર્શાવે છે. | |
− | | | + | |
− | + | ||
|- | |- | ||
− | |||
| 05.13 | | 05.13 | ||
− | + | | ડેટાબેઝો સાથે પરસ્પર લેવાણ દેવાણની સર્વસામાન્ય રીત એટલે '''SQL Editor''' (એસકયુએલ એડીટર). | |
− | | | + | |
|- | |- | ||
− | |||
| 05.19 | | 05.19 | ||
+ | | એ માટે નેટબીન્સ પાસે બિલ્ટ-ઇન '''SQL Editor''' (એસકયુએલ એડીટર) છે. | ||
− | |||
|- | |- | ||
− | |||
| 05.23 | | 05.23 | ||
− | + | | તમે આને '''connection''' (કનેક્શન) નોડ પર જમણું-ક્લિક કરીને એક્સેસ કરી શકો છો. | |
− | | | + | |
|- | |- | ||
− | |||
| 05.29 | | 05.29 | ||
− | + | | ચાલો અત્યારે '''SQL Editor''' (એસકયુએલ એડીટર) વાપરીને એક નવું ડેટાબેઝ ઇનસ્ટંસ બનાવીએ. | |
− | | | + | |
|- | |- | ||
− | |||
| 05.34 | | 05.34 | ||
− | + | | '''Services''' (સર્વિસેઝ) વિન્ડોમાં, '''MySQL''' સર્વર નોડ પર જમણું-ક્લિક કરીને '''Create Database''' (ક્રિએટ ડેટાબેઝ) પસંદ કરો. | |
− | | | + | |
|- | |- | ||
− | |||
| 05.44 | | 05.44 | ||
− | + | | '''Create Database''' (ક્રિએટ ડેટાબેઝ) ડાયલોગમાં, નવા ડેટાબેઝનું નામ ટાઈપ કરો. | |
− | | | + | |
|- | |- | ||
| 05.50 | | 05.50 | ||
− | | | + | | હું આને '''mynewdatabase''' નામ આપીશ. |
− | + | ||
|- | |- | ||
− | |||
| 05.56 | | 05.56 | ||
+ | | તમે આપેલ યુઝરને પૂર્ણ એક્સેસ પણ પ્રદાન કરી શકો છો. | ||
− | |||
|- | |- | ||
− | |||
| 06.01 | | 06.01 | ||
− | + | | મૂળભૂત રીતે, ફક્ત એડમીન યુઝરને જ ચોક્કસ આદેશો ભજવવાની પરવાનગીઓ હોય છે. | |
− | | | + | |
|- | |- | ||
− | |||
| 06.08 | | 06.08 | ||
− | + | | ડ્રોપ-ડાઉન યાદી તમને કોઈ ચોક્કસ વપરાશકર્તાને આ પરવાનગીઓ સોપવાની પરવાનગી આપે છે. | |
− | | | + | |
|- | |- | ||
− | |||
| 06.13 | | 06.13 | ||
− | + | | યુઝરને ફક્ત '''drop tables''' (ડ્રોપ ટેબલ્સ) શિવાય, વધારે પરવાનગી આપવાનું યોગ્ય રહેશે. | |
− | | | + | |
− | + | ||
|- | |- | ||
− | |||
| 06.18 | | 06.18 | ||
− | + | | અને યુઝરને ફક્ત એ જ ડેટાબેઝોને મોડીફાય કરવાની પરવાનગી આપો જે કે તેઓની એપ્લીકેશનથી બન્યા છે. | |
− | | | + | |
− | + | ||
|- | |- | ||
− | |||
| 06.25 | | 06.25 | ||
− | + | | પરંતુ હમણાં માટે, આપણે આ ચેકબોક્સ નાપસંદ કરેલું રહેવા દઈશું. | |
− | | | + | |
|- | |- | ||
− | |||
| 06.30 | | 06.30 | ||
− | + | | '''OK''' ક્લિક કરો. | |
− | | | + | |
− | + | ||
|- | |- | ||
| 06.34 | | 06.34 | ||
− | | | + | | ચાલો હવે ટેબલો બનાવીને, તેને ડેટા વડે ભરીએ, અને ટેબલોમાં આવેલ ડેટાને મોડીફાય કરીએ. |
+ | |||
|- | |- | ||
− | |||
| 06.41 | | 06.41 | ||
− | + | | હાલમાં '''mynewdatabase''' ખાલી છે. | |
− | | '''mynewdatabase''' | + | |
|- | |- | ||
| 06.44 | | 06.44 | ||
− | | | + | | ચાલો ટેબલોમાં ડેટા ઈનપુટ કરવાની પહેલી પદ્ધતિનું અન્વેષણ કરીએ. |
− | + | ||
− | + | ||
|- | |- | ||
− | |||
| 06.48 | | 06.48 | ||
+ | | '''Database''' (ડેટાબેઝ) એક્સપ્લોરરમાં, '''mynewdatabase''' કનેક્શન નોડને વિસ્તૃત કરો. | ||
− | |||
|- | |- | ||
− | |||
| 06.58 | | 06.58 | ||
− | + | | અહીં ત્રણ ઉપ ફોલ્ડરો છે: | |
− | | | + | |
|- | |- | ||
− | |||
| 07.00 | | 07.00 | ||
− | + | | '''Tables''' (ટેબલ્સ), '''Views''' (વ્યુસ) અને '''Procedures''' (પ્રોસીજર્સ). | |
− | |''' Tables, Views''' | + | |
− | + | ||
− | + | ||
|- | |- | ||
− | |||
| 07.04 | | 07.04 | ||
− | + | | '''Tables''' (ટેબલ્સ) ફોલ્ડર પર જમણું-ક્લિક કરો અને '''Execute Command''' (એક્ઝીક્યુટ કમાંડ) પસંદ કરો. | |
− | | | + | |
|- | |- | ||
− | |||
| 07.11 | | 07.11 | ||
+ | | મુખ્ય વિન્ડોનાં '''SQL''' એડીટરમાં એક ખાલી કેનવાસ ખુલે છે. | ||
− | |||
|- | |- | ||
− | |||
| 07.16 | | 07.16 | ||
+ | | ચાલો આ '''SQL''' એડીટરમાં એક સાદી ક્વેરી ટાઈપ કરીએ. | ||
− | |||
|- | |- | ||
− | |||
| 07.30 | | 07.30 | ||
− | + | | આપણે હવે '''SQL''' એડીટરમાં એક સાદી ક્વેરી ટાઈપ કરી છે. | |
− | | | + | |
− | + | ||
|- | |- |
Revision as of 19:39, 15 July 2014
Time | Narration |
00.00 | નમસ્કાર. |
00.02 | Connecting to a MySQL Database પરના ટ્યુટોરીયલમાં સ્વાગત છે. |
00.07 | આ ટ્યુટોરીયલમાં આપણે આપેલ વિશે જોઈશું, |
00.09 | MySQL server properties (સર્વર પ્રોપર્ટીઝ) કોન્ફીગર કરવી. |
00.14 | MySQL સર્વર શરુ કરવું. |
00.17 | ડેટાબેઝ બનાવીને તેની સાથે જોડાણ કરવું. |
00.20 | ડેટાબેઝ ટેબલો બનાવવાનું, જેમાં આપણે બે પદ્ધતિઓનું અન્વેષણ કરીશું: |
00.26 | sql એડીટર વાપરીને, |
00.29 | create table (ક્રિએટ ટેબલ) ડાયલોગ વાપરીને અને છેલ્લે, |
00.33 | SQL સ્ક્રીપ્ટ રન કરીને. |
00.37 | આ ડેમોનસ્ટ્રેશન માટે, હું વાપરી રહ્યી છું Linux Operating System Ubuntu (લીનક્સ ઓપરેટીંગ સીસ્ટમ ઉબુન્ટુ) v12.04. |
00.44 | અને Netbeans IDE (નેટબીન્સ આઈડીઈ) v7.1.1 |
00.48 | સાથે જ તમને Java Development Kit (જાવા ડેવલોપમેન્ટ કીટ) JDK (જેડીકે) v6 |
00.54 | અને MySQL database server (માયએસક્યુએલ ડેટાબેઝ સર્વર) ની પણ જરૂર પડશે. |
00.57 | આ ટ્યુટોરીયલ શીખવા માટે, ડેટાબેઝ management (મેનેજમેંટ) ની સામાન્ય જાણકારી હોવી જરૂરી છે. |
01.03 | વધુ જાણવા માટે, દર્શાવેલ લીંક પર આવેલ PHPandMySQL સ્પોકન ટ્યુટોરીયલો નિહાળો. |
01.10 | આ ટ્યુટોરીયલમાં સર્વસામાન્ય પ્રોગ્રામિંગ પરિભાષા વાપરવામાં આવી છે. |
01.16 | આ ટ્યુટોરીયલ Netbeans IDE (નેટબીન્સ આઈડીઈ) માંથી MySQL ડેટાબેઝનું જોડાણ કઈ રીતે સુયોજિત કરવું એ ડેમોનસ્ટ્રેટ કરે છે. |
01.24 | જોડાણ થતાની સાથે, આપણે IDE નાં ડેટાબેઝ એક્સપ્લોરરમાં MySQL સાથે કામ કરીશું. |
01.31 | ચાલો અત્યારે IDE પર જઈએ. |
01.36 | નેટબીન્સ આઈડીઈમાં MySQL RDBMS નો આધાર અંતર્ભુત છે. |
01.42 | એ પહેલા કે તમે નેટબીન્સમાં MySQL ડેટાબેઝ સર્વર એક્સેસ કરો, તમને MySQL સર્વર પ્રોપર્ટીઝ કોન્ફીગર કરવી જોઈએ. |
01.51 | Services (સર્વિસેઝ) વિન્ડોમાં ડેટાબેઝીસ નોડ પર જમણું-ક્લિક કરો. |
01.56 | MySQL સર્વર પ્રોપર્ટીઝ ડાયલોગ બોક્સ ખોલવા માટે Register MySQL Server (રજીસ્ટર માયએસક્યુએલ સર્વર) પસંદ કરો. |
02.05 | સર્વર હોસ્ટ નામ અને પોર્ટ યોગ્ય છે કે એની ખાતરી કરી લો. |
02.10 | એ વાતની નોંધ લો કે IDE મૂળભૂત રીતે સર્વર હોસ્ટ નામ localhost (લોકલહોસ્ટ) તરીકે દાખલ કરે છે. |
02.18 | 3306 એ સર્વરનો મૂળભૂત પોર્ટ ક્રમાંક છે. |
02.23 | Administrator Username (એડમીનીસ્ટ્રેટર યુઝરનેમ) જો ન દર્શાવ્યું હોય તો તે દાખલ કરો |
02.27 | આપણી સીસ્ટમમાં, એડમીનીસ્ટ્રેટર યુઝરનેમ root (રૂટ) છે |
02.33 | એડમીનીસ્ટ્રેટર પાસવર્ડ નાખો. |
02.36 | આપણી સીસ્ટમમાં, પાસવર્ડ ખાલી છે એટલે કે નથી. |
02.40 | ડાયલોગ બોક્સની ટોંચે આવેલ Admin Properties (એડમીન પ્રોપર્ટીઝ) ટેબને ક્લિક કરો. |
02.45 | આ આપણને MySQL સર્વરને નિયંત્રણ કરવા માટે માહિતી દાખલ કરવાની પરવાનગી આપે છે. |
02.51 | Path/URL to admin tool: ફીલ્ડમાં, |
02.56 | ટાઈપ કરો અથવા MySQL Administration application (માયએસક્યુએલ એડમીનીસ્ટ્રેશન એપ્લીકેશન) નાં સ્થાનને બ્રાઉઝ કરો. |
03.02 | આપણી સીસ્ટમમાં, ટૂલનું location (લોકેશન) /usr/bin/mysqladmin છે |
03.12 | Arguments (આર્ગ્યુંમેંટ્સ) ફીલ્ડમાં admin (એડમીન) ટૂલ માટે કોઈપણ આર્ગ્યુંમેંટ ટાઈપ કરો. |
03.18 | આને પણ ખાલી રાખી શકાવાય છે. |
03.22 | Path to start command: (પાથ ટુ સ્ટાર્ટ કમાંડ) ફીલ્ડમાં |
03.25 | ટાઈપ કરો અથવા MySQL start command (માયએસક્યુએલ સ્ટાર્ટ કમાંડ) નાં સ્થાનને બ્રાઉઝ કરો. |
03.29 | આપણી સીસ્ટમમાં તે /usr/bin/mysqld_safe છે |
03.38 | Arguments (આર્ગ્યુંમેંટ્સ) ફીલ્ડમાં start (સ્ટાર્ટ) કમાંડ માટે કોઈપણ આર્ગ્યુંમેંટ ટાઈપ કરો. |
03.42 | અહીં, હું ટાઈપ કરીશ -u space root space start (-યુ સ્પેસ રૂટ સ્પેસ સ્ટાર્ટ) |
03.51 | Path to stop command: (પાથ ટુ સ્ટોપ કમાંડ) માં |
03.54 | ટાઈપ કરો અથવા MySQL stop command (માયએસક્યુએલ સ્ટોપ કમાંડ) નાં સ્થાનને બ્રાઉઝ કરો. |
03.58 | સામાન્ય રીતે આ mysqladmin પર જવાનો માર્ગ છે જે કે MySQL installation directory (માયએસક્યુએલ ઈંસ્ટોલેશન ડિરેક્ટરી) નાં bin (બીન) ફોલ્ડરમાં છે. |
04.06 | આપણી સીસ્ટમમાં આ /usr/bin/mysqladmin છે |
04.14 | જો કમાંડ mysqladmin હોય તો, Arguments (આર્ગ્યુંમેંટ્સ) ફીલ્ડમાં, ટાઈપ કરો -u space root space stop. |
04.27 | પૂર્ણ થવા પર, Admin Properties (એડમીન પ્રોપર્ટીઝ) ટેબ સ્ક્રીન પર દર્શાવ્યા પ્રમાણે દેખાવું જોઈએ. |
04.33 | OK ક્લિક કરો. |
04.36 | સૌપ્રથમ એ વાતની ખાતરી કરી લો કે MySQL ડેટાબેઝ આપણી મશીન પર ચાલી રહ્યું છે કે. |
04.42 | સર્વિસ વિન્ડોમાંની MySQL સર્વર નોડ, MySQL ડેટાબેઝ જોડાણ થયું છે કે નહી તે દર્શાવે છે. |
04.52 | એ વાતની ખાતરી કરીને કે તે રન થઇ રહ્યું છે, Databases (ડેટાબેસીઝ) >> MySQL server node (માયએસકયુએલ સર્વર નોડ) પર જમણું-ક્લિક કરો અને Connect (કનેક્ટ) પસંદ કરો. |
05.05 | જેમ વિસ્તૃત કરીએ છીએ, તેમ MySQL સર્વર નોડ તમામ ઉપલબ્ધ MySQL ડેટાબેઝો દર્શાવે છે. |
05.13 | ડેટાબેઝો સાથે પરસ્પર લેવાણ દેવાણની સર્વસામાન્ય રીત એટલે SQL Editor (એસકયુએલ એડીટર). |
05.19 | એ માટે નેટબીન્સ પાસે બિલ્ટ-ઇન SQL Editor (એસકયુએલ એડીટર) છે. |
05.23 | તમે આને connection (કનેક્શન) નોડ પર જમણું-ક્લિક કરીને એક્સેસ કરી શકો છો. |
05.29 | ચાલો અત્યારે SQL Editor (એસકયુએલ એડીટર) વાપરીને એક નવું ડેટાબેઝ ઇનસ્ટંસ બનાવીએ. |
05.34 | Services (સર્વિસેઝ) વિન્ડોમાં, MySQL સર્વર નોડ પર જમણું-ક્લિક કરીને Create Database (ક્રિએટ ડેટાબેઝ) પસંદ કરો. |
05.44 | Create Database (ક્રિએટ ડેટાબેઝ) ડાયલોગમાં, નવા ડેટાબેઝનું નામ ટાઈપ કરો. |
05.50 | હું આને mynewdatabase નામ આપીશ. |
05.56 | તમે આપેલ યુઝરને પૂર્ણ એક્સેસ પણ પ્રદાન કરી શકો છો. |
06.01 | મૂળભૂત રીતે, ફક્ત એડમીન યુઝરને જ ચોક્કસ આદેશો ભજવવાની પરવાનગીઓ હોય છે. |
06.08 | ડ્રોપ-ડાઉન યાદી તમને કોઈ ચોક્કસ વપરાશકર્તાને આ પરવાનગીઓ સોપવાની પરવાનગી આપે છે. |
06.13 | યુઝરને ફક્ત drop tables (ડ્રોપ ટેબલ્સ) શિવાય, વધારે પરવાનગી આપવાનું યોગ્ય રહેશે. |
06.18 | અને યુઝરને ફક્ત એ જ ડેટાબેઝોને મોડીફાય કરવાની પરવાનગી આપો જે કે તેઓની એપ્લીકેશનથી બન્યા છે. |
06.25 | પરંતુ હમણાં માટે, આપણે આ ચેકબોક્સ નાપસંદ કરેલું રહેવા દઈશું. |
06.30 | OK ક્લિક કરો. |
06.34 | ચાલો હવે ટેબલો બનાવીને, તેને ડેટા વડે ભરીએ, અને ટેબલોમાં આવેલ ડેટાને મોડીફાય કરીએ. |
06.41 | હાલમાં mynewdatabase ખાલી છે. |
06.44 | ચાલો ટેબલોમાં ડેટા ઈનપુટ કરવાની પહેલી પદ્ધતિનું અન્વેષણ કરીએ. |
06.48 | Database (ડેટાબેઝ) એક્સપ્લોરરમાં, mynewdatabase કનેક્શન નોડને વિસ્તૃત કરો. |
06.58 | અહીં ત્રણ ઉપ ફોલ્ડરો છે: |
07.00 | Tables (ટેબલ્સ), Views (વ્યુસ) અને Procedures (પ્રોસીજર્સ). |
07.04 | Tables (ટેબલ્સ) ફોલ્ડર પર જમણું-ક્લિક કરો અને Execute Command (એક્ઝીક્યુટ કમાંડ) પસંદ કરો. |
07.11 | મુખ્ય વિન્ડોનાં SQL એડીટરમાં એક ખાલી કેનવાસ ખુલે છે. |
07.16 | ચાલો આ SQL એડીટરમાં એક સાદી ક્વેરી ટાઈપ કરીએ. |
07.30 | આપણે હવે SQL એડીટરમાં એક સાદી ક્વેરી ટાઈપ કરી છે. |
07.36 | This is a table definition for the Counselor table we are about to create.
|
07.42 | To execute this query, either right-click the Run SQL icon in the task bar at the top.
|
07.51 | Or right-click within the SQL Editor and choose Run Statement.
|
08.00 | The IDE generates the Counselor table in the database. |
08.04 | You can see this message in the Output window, |
08.12 | which says that the command was executed successfully,
|
08.17 | To verify these changes, right-click the Tables node in the Database Explorer.
|
08.25 | Choose Refresh. |
08.28 | This updates the current status of the specified database. |
08.32 | The new Counselor table now displays under the Tables option.
|
08.40 | If you expand the table node, you can see the columns that you created. |
08.46 | Let us now explore the next method to input data in the tables, |
08.51 | i.e. Using the Create Table Dialog |
08.54 | In the Database Explorer, right-click the Tables node, and choose Create Table. |
09.03 | The Create Table dialogue opens. |
09.06 | In the Table name text field, type Subject |
09.13 | Click on Add Column |
09.16 | In the Add Column dialogue, type id in the Name field. |
09.22 | Choose SMALLINT for data-type from the Type drop-down menu. |
09.30 | Select the Primary Key checkbox in the Add Column dialog box. |
09.35 | This is to specify the primary key for your table. |
09.39 | Note that when you select the Key check box, the Index and Unique check boxes are automatically selected; |
09.49 | Also the Null check box is deselected. |
09.53 | This is because primary keys are used to identify a unique row in the database. |
09.59 | Click OK. |
10.03 | Repeat this procedure to add the remaining columns, as shown on the screen. |
10.09 | We have now created a table named Subject that will hold data for Name, Description, and Counselor ID |
10.20 | Click OK. |
10.23 | By running SQL queries on a database, we can add, modify and delete data maintained in database structures. |
10.32 | Let us add a new record to the Counselor table. |
10.35 | Choose Execute Command from the Tables node context menu. |
10.43 | A new SQL Editor opens in the main window.
|
10.47 | In the SQL Editor, let us type a simple query: |
11.00 | To execute this query, right-click within the source editor, and choose Run Statement |
11.07 | Let us now verify if the new record has been added to the table. |
11.12 | Right-click the Counselor table, and choose View Data. |
11.18 | A new SQL Editor opens in the main window. |
11.21 | A query to select all data from the table is automatically generated. |
11.27 | The results of this statement are displayed in a table view below the workspace. |
11.41 | Note that a new row has been added with the data we just supplied. |
11.46 | We can also run an external SQL script directly in the IDE. |
11.52 | I have a SQL query here for demonstrative purposes.
|
11.59 | This script creates two tables similar to the ones we have just created.
|
12.04 | i.e. Counselor and Subject
|
12.09 | Because the script overwrites these tables, |
12.12 | we will delete these two tables if they already exist.
|
12.16 | To delete tables, right-click on the Counselor table |
12.21 | and choose Delete.
|
12.24 | Click Yes in the Confirm Object Deletion dialogue box. |
12.31 | Repeat the same for the Subject table |
12.38 | Now, open the existing SQL query file from your system. |
12.43 | From the File menu, choose Open File. |
12.48 | Browse to the location containing this file. |
12.54 | The script automatically opens in the SQL editor. |
12.59 | Make sure the connection to mynewdatabase is selected. |
13.03 | Check this from the connection drop-down in the toolbar at the top of the editor. |
13.13 | Click the Run SQL button in the task bar. |
13.17 | And the script is executed against the selected database. |
13.22 | Right-click the mynewdatabase connection node and choose Refresh. |
13.28 | This updates the database component to the current status of the specified database. |
13.34 | Right-click on any of these tables now and choose View Data. |
13.41 | And below the workspace, you can see the data contained in the new tables. |
13.52 | In this tutorial you learnt to, |
13.54 | configure MySQL on your computer |
13.57 | set up a connection to the database server from the IDE |
14.02 | create, delete, modify data and |
14.06 | run SQL queries |
14.10 | As an assignment, |
14.11 | Create another database instance with tables |
14.15 | Populate these tables with necessary data to maintain your personal book library
|
14.21 | And run these SQL statements to view data |
14.29 | I have created a similar database which maintains details of my personal movie library. |
14.37 | Your assignment should resemble this.
|
14.44 | Watch the video available at the link shown on the screen. |
14.48 | It summarizes the Spoken Tutorial project. |
14.51 | If you do not have good bandwidth, you can download and watch it. |
14.56 | The Spoken Tutorial project team conduct workshops using Spoken Tutorials.
|
15.01 | Gives certificates to those who pass an online test.
|
15.04 | For more details please write to contact@spoken-tutorial.org
|
15.10 | Spoken Tutorial Project is a part of the Talk to a Teacher Project |
15.15 | It is Supported by the National Mission on education through ICT, MHRD, Government of India |
15.20 | More information on this mission is available at link provided here |
15.27 | This tutorial has been contributed by IT for Change
|
15.30 | Thank you |