Tag Info

Hot answers tagged


You have to be very careful how you pass passwords to command lines as, if you're not careful, you'll end up leaving it open to sniffing using tools such as ps. The safest way to do this would be to create a new config file and pass it to mysql using either the --defaults-file= or --defaults-extra-file= command line option. The difference between the two ...


You can use: help contents to retrieve a list of the top-level help categories. If you type: help 'Data Manipulation' Possible result will be: CALL DELETE DO DUAL HANDLER INSERT INSERT DELAYED INSERT SELECT JOIN LOAD DATA LOAD XML REPLACE SELECT UNION UPDATE More info you can find: Server-Side Help HELP Syntax


If you want to start mysql with a password provided you have to fetch the password in a variable first: MYSQLPASS=`cat foo.php | grep '$dbpwd=' | cut -d '"' -f 2` Then you can start your mysql command with: mysql -U root -p ${MYSQLPASS} mydb -h friendserver


Adding #!/bin/bash did the thing, I just forgot to add that line. Can't really tell, why it does not work on the shell, but somehow it now works inside the script and inside the cronjob. Thanks for the comments.


The connection parameter is a bit of a misnomer. It indicates the number of connections that have been made to the server since the server started. The one you might be interested in is Threads connected.

Only top voted, non community-wiki answers of a minimum length are eligible