SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy mysql -u root mysql -u root mysql -u root

    Hi guys,

    AAAAh

    I'm stuck on page 23 of " Build Your Own Database Driven Website Using PHP and MySQL".

    Could you be a bit more explicit about the info second paragraph:

    "To set the password for MySQL, open a command line prompt (or Terminal window) and type the following command in the bin directory of your MySQL installation:"

    What is the bin directory? Could you provide the full path name please? I think I'm missing a key concept somewhere.

    I simply cannot connect as root so therefore cannot assign a root password. MySQL is running sure enough but I keep getting:

    Last login: Mon Feb 14 21:21:14 on ttyp1
    Welcome to Darwin!
    hivemind:~ stevie$ /usr/local/mysql/bin/mysql
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 22 to server version: 4.1.9-standard

    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

    mysql> Bye
    hivemind:~ stevie$ mysql -u root
    -bash: mysql: command not found
    hivemind:~ stevie$

    What should I be putting in the shell?

    Please help, I love your book but I've been stuck on this page two weekends too long! Yes I have visited :
    http://dev.mysql.com/doc/mysql/en/de...rivileges.html

    Mac OS 10.3.7
    MySQL 4.1.9
    PHP 4.3.10
    Apache is OS X shipped

    Thanks

    Stevie

  2. #2
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you tried "/usr/local/mysql/bin/mysql -u root"? Or "cd /usr/local/mysql/bin/" then you can go "mysql -u root". The reason you get a "Command not found" is because you aren't in the right directory, that's all. Type "ls" to see the contents of the current directory (at least, I'm assuming... it looks rather Linux/unix-like, so I figured it's similar).

  3. #3
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I keep getting Error 1045.I can't authenticate as root. This is what happens:

    Last login: Tue Feb 15 17:05:51 on ttyp1
    Welcome to Darwin!
    hivemind:~ stevie$ /usr/local/mysql/bin/mysql -u root
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
    hivemind:~ stevie$

    Thanks for your suggestions

    cYs

  4. #4
    One website at a time mmj's Avatar
    Join Date
    Feb 2001
    Location
    Melbourne Australia
    Posts
    6,282
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi cYs,

    This error message seems to indicate that you have already set a root password for MySQL. You will need to log in to MySQL using the password you set already.

    For instance: /usr/local/mysql/bin/mysql -uroot -ppassword

    If you continue to have problems let me know.
    [mmj] My magic jigsaw
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The Bit Depth Blog Twitter Contact me
    Neon Javascript Framework Jokes Android stuff

  5. #5
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hiya Thomas,
    I haven't set a MySQL p/w! This why I'm so eager to connect as root so that I can set a password and secure my server.

    Last login: Thu Feb 17 17:19:35 on ttyp1
    Welcome to Darwin!
    hivemind:~ stevie$ /usr/local/mysql/bin/mysql -uroot -ppassword
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
    hivemind:~ stevie$

    Still no cigar!

    Thanks for your help.

    cYs

  6. #6
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Stuck Too!

    I'm in cYs's boots. I too can't get past page 23.

    "To set a root pasword for MySQL, open a command prompt (or Terminal window) and type the following command in the bin directory of your MySQL installation:

    Code:
    mysql -u root mysql
    Here's what I get:

    Code:
    127:/ momdad$ cd /usr/local/mysql/bin/mysql
    -bash: cd: /usr/local/mysql/bin/mysql: Not a directory
    127:/ momdad$ cd /usr/local/mysql/bin
    127:/usr/local/mysql/bin momdad$ ls -l
    total 68192
    -rwxr-xr-x  1 root  wheel   929436 12 Feb 23:51 comp_err
    -rwxr-xr-x  1 root  wheel    15711 12 Feb 23:43 fill_help_tables
    -rwxr-xr-x  1 root  wheel  1078304 12 Feb 23:51 isamchk
    -rwxr-xr-x  1 root  wheel     2008 12 Feb 23:43 make_sharedlib_distribution
    -rwxr-xr-x  1 root  wheel     4437 12 Feb 23:43 make_win_binary_distribution
    -rwxr-xr-x  1 root  wheel     9265 12 Feb 23:43 make_win_src_distribution
    -rwxr-xr-x  1 root  wheel     1474 12 Feb 23:43 msql2mysql
    -rwxr-xr-x  1 root  wheel    73080 12 Feb 23:51 my_print_defaults
    -rwxr-xr-x  1 root  wheel  1131500 12 Feb 23:51 myisam_ftdump
    -rwxr-xr-x  1 root  wheel  1234604 12 Feb 23:51 myisamchk
    -rwxr-xr-x  1 root  wheel  1139992 12 Feb 23:51 myisamlog
    -rwxr-xr-x  1 root  wheel  1164664 12 Feb 23:51 myisampack
    -rwxr-xr-x  1 root  wheel  1214968 12 Feb 23:51 mysql
    -rwxr-xr-x  1 root  wheel  1487092 12 Feb 23:51 mysql_client_test
    -rwxr-xr-x  1 root  wheel  4865656 12 Feb 23:51 mysql_client_test_embedded
    -rwxr-xr-x  1 root  wheel     4294 12 Feb 23:43 mysql_config
    -rwxr-xr-x  1 root  wheel     2977 12 Feb 23:43 mysql_convert_table_format
    -rwxr-xr-x  1 root  wheel    29528 12 Feb 23:43 mysql_create_system_tables
    -rwxr-xr-x  1 root  wheel    10419 12 Feb 23:43 mysql_explain_log
    -rwxr-xr-x  1 root  wheel     2653 12 Feb 23:43 mysql_find_rows
    -rwxr-xr-x  1 root  wheel      483 12 Feb 23:43 mysql_fix_extensions
    -rwxr-xr-x  1 root  wheel     5148 12 Feb 23:43 mysql_fix_privilege_tables
    -rwxr-xr-x  1 root  wheel     6308 12 Feb 23:43 mysql_secure_installation
    -rwxr-xr-x  1 root  wheel    17275 12 Feb 23:43 mysql_setpermission
    -rwxr-xr-x  1 root  wheel    13647 12 Feb 23:43 mysql_tableinfo
    -rwxr-xr-x  1 root  wheel    60620 12 Feb 23:51 mysql_tzinfo_to_sql
    -rwxr-xr-x  1 root  wheel    51760 12 Feb 23:51 mysql_waitpid
    -rwxr-xr-x  1 root  wheel     3118 12 Feb 23:43 mysql_zap
    -rwxr-xr-x  1 root  wheel   110691 12 Feb 23:43 mysqlaccess
    -rwxr-xr-x  1 root  wheel     1702 12 Feb 15:37 mysqlaccess.conf
    -rwxr-xr-x  1 root  wheel  1286420 12 Feb 23:51 mysqladmin
    -rwxr-xr-x  1 root  wheel  1049156 12 Feb 23:51 mysqlbinlog
    -rwxr-xr-x  1 root  wheel    10083 12 Feb 23:43 mysqlbug
    -rwxr-xr-x  1 root  wheel  1015960 12 Feb 23:51 mysqlcheck
    -rwxr-xr-x  1 root  wheel  4534780 12 Feb 23:51 mysqld
    -rwxr-xr-x  1 root  wheel   123661 12 Feb 23:51 mysqld.sym.gz
    -rwxr-xr-x  1 root  wheel    22148 12 Feb 23:43 mysqld_multi
    -rwxr-xr-x  1 root  wheel    10904 12 Feb 23:43 mysqld_safe
    -rwxr-xr-x  1 root  wheel  1057020 12 Feb 23:51 mysqldump
    -rwxr-xr-x  1 root  wheel     4986 12 Feb 23:43 mysqldumpslow
    -rwxr-xr-x  1 root  wheel    32316 12 Feb 23:43 mysqlhotcopy
    -rwxr-xr-x  1 root  wheel  1011860 12 Feb 23:51 mysqlimport
    -rwxr-xr-x  1 root  wheel  1033856 12 Feb 23:51 mysqlmanager
    -rwxr-xr-x  1 root  wheel    59996 12 Feb 23:51 mysqlmanager-pwgen
    -rwxr-xr-x  1 root  wheel  1007776 12 Feb 23:51 mysqlmanagerc
    -rwxr-xr-x  1 root  wheel  1011896 12 Feb 23:51 mysqlshow
    -rwxr-xr-x  1 root  wheel  1102408 12 Feb 23:51 mysqltest
    -rwxr-xr-x  1 root  wheel  4439880 12 Feb 23:51 mysqltest_embedded
    -rwxr-xr-x  1 root  wheel  1045336 12 Feb 23:51 pack_isam
    -rwxr-xr-x  1 root  wheel    60364 12 Feb 23:51 perror
    -rwxr-xr-x  1 root  wheel    65036 12 Feb 23:51 replace
    -rwxr-xr-x  1 root  wheel    64624 12 Feb 23:51 resolve_stack_dump
    -rwxr-xr-x  1 root  wheel    60508 12 Feb 23:51 resolveip
    lrwxr-xr-x  1 root  wheel       11 18 Feb 23:29 safe_mysqld -> mysqld_safe
    127:/usr/local/mysql/bin momdad$ mysql
    -bash: mysql: command not found
    127:/usr/local/mysql/bin momdad$ mysql -u root
    -bash: mysql: command not found
    127:/usr/local/mysql/bin momdad$ mysql -u root
    -bash: mysql: command not found
    127:/usr/local/mysql/bin momdad$ mysql -uroot -ppassword
    -bash: mysql: command not found
    127:/usr/local/mysql/bin momdad$
    At this point, I'm stumped. I wonder how to remove all instances of the mysql user and files from the installation? Any suggestions? ... so I can reinstall a fresh version.
    Last edited by Stuke; Feb 19, 2005 at 13:01. Reason: code formating is not like 'vB code' example
    Stuke
    Mac OS X (10.3.8) with Apache HTTP Server Version 1.3
    mysql-standard-4.1.10-apple-darwin7.7.0-powerpc
    Entropy-PHP-5.0.3-1

  7. #7
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Stuck Too ... can duplicate cYs

    I've been able to duplicate cYs's experience at the terminal window.

    Code:
    [127:~] momdad% /usr/local/mysql/bin/mysql 
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 9 to server version: 4.1.10-standard
    
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    
    mysql> quit
    Bye
    [127:~] momdad% /usr/local/mysql/bin/mysql -u root mysql
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
    [127:~] momdad% /usr/local/mysql/bin/mysql -uroot -ppassword
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
    [127:~] momdad%
    This is why page 23 in Sitepoint's book is so confusing! I suppose I don't need to remove and reinstall MySQL since I can "get in." However, can Apple's NetInfo Manager be used to secure the mysql user's root password? Does that question even make sense?
    Last edited by Stuke; Feb 19, 2005 at 13:57. Reason: added comments about password
    Stuke
    Mac OS X (10.3.8) with Apache HTTP Server Version 1.3
    mysql-standard-4.1.10-apple-darwin7.7.0-powerpc
    Entropy-PHP-5.0.3-1

  8. #8
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Stuke,

    Did you find a command for uninstalling MySQL?

    I wonder if anyone has got MySQL to sit on OS 10.3? Great to hear from you.

    Thanks

    cYs

  9. #9
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello Thomas,

    I haven't set a password.

    Last login: Mon Feb 21 21:10:16 on ttyp1
    Welcome to Darwin!
    hivemind:~ stevie$ /usr/local/mysql/bin/mysql -uroot -ppassword
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
    hivemind:~ stevie$

    Thomas, do you know of a command to uninstall MySQL 4.1.9?

    Thanks

    cYs

  10. #10
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I'm in...

    I'm in!

    But, I'm not entirely sure how I set my root password

    I was able to log in following this command set (in bash):
    Code:
    Last login: Mon Feb 21 16:37:22 on console
    Welcome to Darwin!
    Stoughs-Computer:~ momdad$ cd /
    Stoughs-Computer:/ momdad$ usr/local/mysql/bin/mysql -h localhost -u root -p
    Enter password: 
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 83 to server version: 4.1.10-standard
    
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    
    mysql> SHOW DATABASES;
    +----------+
    | Database |
    +----------+
    | ijdb     |
    | mysql    |
    | test     |
    +----------+
    3 rows in set (0.00 sec)
    
    mysql>
    I've also downloaded Stuart Glenn's version of CocoaMySQL (version 0.6.3) from CocoaMySQL-SBG because version 0.5 doesn't work with MySQL 4.1.10-standard (my installation). I've been able to log-in using "localhost" "root" and "mypassword". Hint...once you enter all three, save it as a favorite.

    I'm into Chp 4 of Yank's book and am able to work with the MySQL databases in three forms...Terminal, CocoaMySQL-SBG, and PHP/web.

    cYs...hang in there, if I can remember where I set the password, I'll let you know. You might just keep trying the above command (beginning usr/local...) with all your different passwords...one may work!
    Last edited by Stuke; Feb 22, 2005 at 07:10. Reason: fixed the URL link to SBG's CocoaMySQL
    Stuke
    Mac OS X (10.3.8) with Apache HTTP Server Version 1.3
    mysql-standard-4.1.10-apple-darwin7.7.0-powerpc
    Entropy-PHP-5.0.3-1


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •