{"id":21,"date":"2005-10-23T18:19:09","date_gmt":"2005-10-23T23:19:09","guid":{"rendered":"http:\/\/www.juixe.com\/techknow\/?p=21"},"modified":"2009-07-21T22:42:12","modified_gmt":"2009-07-22T05:42:12","slug":"mysql-admin","status":"publish","type":"post","link":"http:\/\/juixe.com\/techknow\/index.php\/2005\/10\/23\/mysql-admin\/","title":{"rendered":"MySQL Admin"},"content":{"rendered":"<p>If you do any web development either with PHP, JSP, and\/or Ruby on Rails you most likely will use MySQL.  The following is all that you need to know to get started with MySQL.  I am currently using MySQL 4.1.14.  To install MySQL just unzipped it to the c:\\ drive.  To start the MySQL server cd to the bin directory and execute the following:<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nbin&gt;mysqld\r\n<\/pre>\n<p>Once the server has started you can connect using the command line tool <b>mysql<\/b>.  From a command prompt, just type the following:<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nbin&gt;mysql\r\n<\/pre>\n<p>Once logged on you can view the available databases by running this command:<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nshow databases;\r\n<\/pre>\n<p>To create a new database use the create command as in:<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\ncreate database &lt;database_name&gt;;\r\n<\/pre>\n<p>Of course, you will need to replace &lt;database_name&gt; with an appropriate name.  To start using a specific database from those available enter the following command:<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nuse &lt;database_name&gt;;\r\n<\/pre>\n<p>It is nice to list all the defined tables in a database schema, to do so in MySQL enter this next command:<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nshow tables;\r\n<\/pre>\n<p>And if you are like me and suffer from development amnesia, you will fail to remember those hardly ever used table column names.  Well, the next command describes a given table&#8217;s metadata such as column name and type:<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\ndescribe &lt;table_name&gt;;\r\n<\/pre>\n<p>Once you have created your database and database tables, you will most likely need to create a user for that database schema.  To create a user, execute the following:<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\ngrant all on &lt;database_name&gt;.* to\r\n&lt;user_name&gt;@localhost identified by '&lt;password&gt;';\r\n<\/pre>\n<p>And when you are done you can stop the server by executing the following:<\/p>\n<pre class=\"brush: sql; title: ; notranslate\" title=\"\">\r\nbin&gt;mysqladmin -u root shutdown\r\n<\/pre>\n<p>There is a lot more to MySQL than this short tutorial.  Like Oracle and other databases, MySQL provides import and export functionality (see load data command).  In addition to the typical selects, updates, and delete statements these are the only other commands that I regularly use when using MySQL.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you do any web development either with PHP, JSP, and\/or Ruby on Rails you most likely will use MySQL. The following is all that you need to know to get started with MySQL. I am currently using MySQL 4.1.14. To install MySQL just unzipped it to the c:\\ drive. To start the MySQL server [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":""},"categories":[23,3],"tags":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p902K-l","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts\/21"}],"collection":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/comments?post=21"}],"version-history":[{"count":2,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts\/21\/revisions"}],"predecessor-version":[{"id":801,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts\/21\/revisions\/801"}],"wp:attachment":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/media?parent=21"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/categories?post=21"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/tags?post=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}