 |
Linux Format forums Help, discussion, magazine feedback and more
|
| View previous topic :: View next topic |
| Author |
Message |
gdawg
Joined: Fri Nov 18, 2011 2:55 pm Posts: 11 Location: New Mexico, USA
|
Posted: Wed Mar 21, 2012 12:32 am Post subject: Problem Setting-Up MySQL Per LXF151 Modern Perl |
|
|
Hi - After jumping thru hoops getting and installing MySQL I'm having a problem creating the 'books' database. This is where I'm stalled: | Code: | mysql> create user 'books'@'localhost' identified by 'README';
ERROR 1396 (HY000): Operation CREATE USER failed for 'books'@'localhost'
The magazine article shows this as the second entry and the LXFDVD shows it at end. I've tried it both ways with same result. I've never used MySQL before so I'm unsure of how to correct this error. All help is appreciated.
Linux gdawg-Satellite-C675 2.6.38-8-generic-pae #42-Ubuntu SMP Mon Apr 11 05:17:09 UTC 2011 i686 i686 i386 GNU/Linux
|
|
|
| Back to top |
|
 |
johnhudson LXF regular
Joined: Wed Aug 03, 2005 2:37 pm Posts: 767
|
Posted: Sun Mar 25, 2012 4:02 pm Post subject: |
|
|
A bit of terminological inexactitude here:
To create anything, you normally need to be 'root'
To create a database called books, you enter:
CREATE DATABASE books;
I would not then normally create a user called 'books' - 'guest' or 'reader' would be better if you want lots of people to access the database.
Though I cannot see anything wrong with the syntax of your CREATE USER statement, it may be worth checking that you were logged in as root and, if so, the contents of mysql.user (that is, the user table in the mysql database).
However, for adding users I prefer
USE mysql
INSERT INTO user (Host,User,Password) VALUES ('host','user',PASSWORD('password'));
FLUSH PRIVILEGES;
which hashes the password immediately.
Note that both leave your password exposed in the mysql_history file; so open an editor and delete these lines in your mysql-history file.
mysql is supplied as default with no passwords and two anonymous users anyway. It is possible the version you have installed comes with a different configuration of mysql.user.
Finally, the mysql documentation - open a console and enter 'info mysql' - is excellent and well worth reading with care if you are new to it - though, because it is so big, you may find difficulty wading through it all for the nuggets you need. There are plenty of easy introductions too. |
|
| Back to top |
|
 |
lok1950 LXF regular

Joined: Tue May 31, 2005 6:31 am Posts: 958 Location: Ottawa
|
Posted: Sun Mar 25, 2012 5:30 pm Post subject: |
|
|
| Quote: | | though, because it is so big, you may find difficulty wading through it all for the nuggets you need. There are plenty of easy introductions too. |
And if you use KDE you don't have wade though it in a terminal call up the KDE info center.
Enjoy the Choice  |
|
| Back to top |
|
 |
gdawg
Joined: Fri Nov 18, 2011 2:55 pm Posts: 11 Location: New Mexico, USA
|
Posted: Mon Mar 26, 2012 1:28 am Post subject: |
|
|
Thank you both for your replies. I can see I need to do some studying of MySQL instead of just following directions in magazine. I appreciate your help.
Following the Modern Perl tutorial in LXF 151, authored by Dave Cross, I have been able to progress past the MySQL section and am now attempting to implement the Perl section.
Under the 'Find the author' paragraph there is a requirement to 'get the ISBN of a book from Amazon' using this entry in the console: ./book add 0330258648
./book list
I get this result when I enter the 1st command: | Code: | gdawg-Satellite-C675 jane # ./book add 0330258648
Can't locate Net/Amazon.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at ./book line 7.
BEGIN failed--compilation aborted at ./book line 7
Any help with this will be very much appreciated.
Linux gdawg-Satellite-C675 2.6.38-8-generic-pae #42-Ubuntu SMP Mon Apr 11 05:17:09 UTC 2011 i686 i686 i386 GNU/Linux
|
|
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|