Re: -p password
James Austin wrote: Hi all, A novice question: How can I do away with having to use the -u user and -p password arguments every time I execute the mysql command? When I create a table with a script the only way I can get it to work is with the command: $ mysql samp_db -u root -p create_member.sql $ Enter password: What can I do to not have to enter a user and password each time? Can I use the script at the mysql prompt? This way I would only have to enter the user and password once. Thanks very much, Jim - Create .my.cnf in your home directory with: [client] user = username password = real-big-secret Van -- = Linux rocks!!! http://www.dedserius.com/ = - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: -p password
Yes. Thank you. Just put a pair of around password and it works fine. I had thought this could be handled in mysql, but hey, this works. rc wrote: one way would bein bash - edit your .bashrc file to include the following: alias mysql='mysql -u username -p password' On Thu, 21 Feb 2002, James Austin wrote: Hi all, A novice question: How can I do away with having to use the -u user and -p password arguments every time I execute the mysql command? When I create a table with a script the only way I can get it to work is with the command: $ mysql samp_db -u root -p create_member.sql $ Enter password: What can I do to not have to enter a user and password each time? Can I use the script at the mysql prompt? This way I would only have to enter the user and password once. Thanks very much, Jim - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: -p password
actually someone sent an email to the list suggesting using .my.cnf file, which is probably better than using the .bashrc file On Thu, 21 Feb 2002, James Austin wrote: Yes. Thank you. Just put a pair of around password and it works fine. I had thought this could be handled in mysql, but hey, this works. rc wrote: one way would bein bash - edit your .bashrc file to include the following: alias mysql='mysql -u username -p password' On Thu, 21 Feb 2002, James Austin wrote: Hi all, A novice question: How can I do away with having to use the -u user and -p password arguments every time I execute the mysql command? When I create a table with a script the only way I can get it to work is with the command: $ mysql samp_db -u root -p create_member.sql $ Enter password: What can I do to not have to enter a user and password each time? Can I use the script at the mysql prompt? This way I would only have to enter the user and password once. Thanks very much, Jim - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: -p password
At 14:30 -0800 2/21/02, James Austin wrote: Yes. Thank you. Just put a pair of around password and it works fine. I had thought this could be handled in mysql, but hey, this works. I don't see how it *could* work. When the password is given on the command line, it must follow the -p with no intervening space. rc wrote: one way would bein bash - edit your .bashrc file to include the following: alias mysql='mysql -u username -p password' On Thu, 21 Feb 2002, James Austin wrote: Hi all, A novice question: How can I do away with having to use the -u user and -p password arguments every time I execute the mysql command? When I create a table with a script the only way I can get it to work is with the command: $ mysql samp_db -u root -p create_member.sql $ Enter password: What can I do to not have to enter a user and password each time? Can I use the script at the mysql prompt? This way I would only have to enter the user and password once. Thanks very much, Jim - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: -p password
shockingly enough it works like this: alias mysql='mysql -u username -ppassword' On Thu, 21 Feb 2002, Paul DuBois wrote: At 14:30 -0800 2/21/02, James Austin wrote: Yes. Thank you. Just put a pair of around password and it works fine. I had thought this could be handled in mysql, but hey, this works. I don't see how it *could* work. When the password is given on the command line, it must follow the -p with no intervening space. rc wrote: one way would bein bash - edit your .bashrc file to include the following: alias mysql='mysql -u username -p password' On Thu, 21 Feb 2002, James Austin wrote: Hi all, A novice question: How can I do away with having to use the -u user and -p password arguments every time I execute the mysql command? When I create a table with a script the only way I can get it to work is with the command: $ mysql samp_db -u root -p create_member.sql $ Enter password: What can I do to not have to enter a user and password each time? Can I use the script at the mysql prompt? This way I would only have to enter the user and password once. Thanks very much, Jim - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: -p password
I put this line (with no space after the -p) in the .bashrc file and sourced it; alias mysql='mysql -u root -pbig_secret' It gets me in ok. Van suggested the mysql way putting this in a .my.cnf file in my home directory. [client] user=username password=big_secret I know this is basic stuff, but I've got good help and a good book... thanks Paul DuBois wrote: At 14:30 -0800 2/21/02, James Austin wrote: Yes. Thank you. Just put a pair of around password and it works fine. I had thought this could be handled in mysql, but hey, this works. I don't see how it *could* work. When the password is given on the command line, it must follow the -p with no intervening space. rc wrote: one way would bein bash - edit your .bashrc file to include the following: alias mysql='mysql -u username -p password' On Thu, 21 Feb 2002, James Austin wrote: Hi all, A novice question: How can I do away with having to use the -u user and -p password arguments every time I execute the mysql command? When I create a table with a script the only way I can get it to work is with the command: $ mysql samp_db -u root -p create_member.sql $ Enter password: What can I do to not have to enter a user and password each time? Can I use the script at the mysql prompt? This way I would only have to enter the user and password once. Thanks very much, Jim - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: -p password
James Austin wrote: I put this line (with no space after the -p) in the .bashrc file and sourced it; alias mysql='mysql -u root -pbig_secret' It gets me in ok. Van suggested the mysql way putting this in a .my.cnf file in my home directory. [client] user=username password=big_secret The .bashrc trick works, but .my.cnf or my.cnf is platform-nonspecific. Many of the readers of the list don't use *n*x workstations. However, those who do can take advantage of other bourne-again shell tricks like: trap ~/.logout 0 at the end of .bashrc .profile or .bash_profile where .logout is chmod-ded +x and contains commands to do clean-up tasks upon exiting the shell. But, of course we're heading off-topic. Van -- = Linux rocks!!! http://www.dedserius.com/ = - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: -p password
alias mysql='mysql -u root -pbig_secret' Another, more reliable way, is to use the long-form options and say mysql --user=root --password=big_secret -- Shankar. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: -p password
Hi there, the other comments may have got you where you want but as no one had mentioned your final option thought I'd mention (from /h at the mysql command line) source (\.)Execute a SQL script file. Takes a file name as an argument. so you can run the script from the mysql prompt. cheers, noel On Friday, February 22, 2002 8:41 AM, James Austin [SMTP:[EMAIL PROTECTED]] wrote: Hi all, A novice question: How can I do away with having to use the -u user and -p password arguments every time I execute the mysql command? When I create a table with a script the only way I can get it to work is with the command: $ mysql samp_db -u root -p create_member.sql $ Enter password: What can I do to not have to enter a user and password each time? Can I use the script at the mysql prompt? This way I would only have to enter the user and password once. Thanks very much, Jim - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php