MySQL commands: Difference between revisions

Jump to navigation Jump to search
No change in size ,  1 January 2016
Line 5: Line 5:
* {{Win}}: Install (1) [https://www.cygwin.com/ Cygwin], (2) search mysql & install MySQL database clients apps package
* {{Win}}: Install (1) [https://www.cygwin.com/ Cygwin], (2) search mysql & install MySQL database clients apps package
* {{Mac}}: Install [https://www.apachefriends.org/zh_tw/download.html XAMPP]. Path of {{kbd | key=mysql}} executable file is: /Applications/xampp/xamppfiles/bin/mysql
* {{Mac}}: Install [https://www.apachefriends.org/zh_tw/download.html XAMPP]. Path of {{kbd | key=mysql}} executable file is: /Applications/xampp/xamppfiles/bin/mysql
create the db user
# create the db user
# grant the minimum permission: {{kbd | key=SELECT}}, {{kbd | key=LOCK TABLES}} to the db user. SQL query: {{kbd | key=<nowiki>GRANT SELECT, LOCK TABLES ON `DATA\_BASE\_NAME`.* TO 'dbuser'@'localhost';</nowiki>}}<ref>[http://serverfault.com/questions/22712/minimum-permissions-for-a-user-to-perform-a-mysqldump security - Minimum permissions for a user to perform a mysqldump? - Server Fault]</ref>
# the db user will be able to execute the mysqldump command


(optional) install the [http://www.ivarch.com/programs/pv.shtml Pipe Viewer] (pv) package
(optional) install the [http://www.ivarch.com/programs/pv.shtml Pipe Viewer] (pv) package
Line 17: Line 12:
* {{Win}}: Install (1) [https://www.cygwin.com/ Cygwin], (2) search pv & install pv package
* {{Win}}: Install (1) [https://www.cygwin.com/ Cygwin], (2) search pv & install pv package
* {{Mac}}: Install (1) {{kbd | key =brew install pv}} to get the latest version of pv package<ref>[http://ashleyangell.com/2013/11/pipe-viewer-pv-in-mac-osx/ Pipe Viewer (pv) in Mac OSX]</ref> and (2) MySQL database clients from [https://www.apachefriends.org/zh_tw/download.html XAMPP]. Path of mysql is: /Applications/xampp/xamppfiles/bin/mysql
* {{Mac}}: Install (1) {{kbd | key =brew install pv}} to get the latest version of pv package<ref>[http://ashleyangell.com/2013/11/pipe-viewer-pv-in-mac-osx/ Pipe Viewer (pv) in Mac OSX]</ref> and (2) MySQL database clients from [https://www.apachefriends.org/zh_tw/download.html XAMPP]. Path of mysql is: /Applications/xampp/xamppfiles/bin/mysql
create the db user
# create the db user
# grant the minimum permission: {{kbd | key=SELECT}}, {{kbd | key=LOCK TABLES}} to the db user. SQL query: {{kbd | key=<nowiki>GRANT SELECT, LOCK TABLES ON `DATA\_BASE\_NAME`.* TO 'dbuser'@'localhost';</nowiki>}}<ref>[http://serverfault.com/questions/22712/minimum-permissions-for-a-user-to-perform-a-mysqldump security - Minimum permissions for a user to perform a mysqldump? - Server Fault]</ref>
# the db user will be able to execute the mysqldump command


=== Exporting data into MySql sql file ===
=== Exporting data into MySql sql file ===

Navigation menu