Having issues running mysql from command line
Hey I'm trying to set up a website using a a remote web server, I'm using CemtOS 5 and I haven't yet set up the GUI so I'm using command line and I was wondering how to run a .sql file through command line
I already tried imputing the command: mysql -u Username -p DBname < program.sql I keep on receiving a prompt saying "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)" any suggestions |
Did you start your MySQL service??
|
yea sorry I'm a complete newb. I havent started mysql service, how would I go about doing that and would it fix the problem
|
Please try this command:
Code:
service mysqld start |
I got
-bash: service: command not found |
Please try
Code:
yum install initscripts |
I tried both commands the 1st one told me I already had it installed and up to date, the second one just installed on the machine, What do I do now?
|
Code:
/etc/init.d/mysqld start Code:
mysql -u Username -p DBname < program.sql |
When I ran the first code it said "Starting MySQL:" When I attempted to run the second code (as root) I recieved "ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)"
|
By default, the password for root is blank.
|
it has been a bit but i thought that MySQL used the default install settings of
username : root password: password think of setting up a LAMP stack as a collage class with a pass/fail a 4.0 or 1 you MUST get a 4.0 so a bit of studying is REQUIRED the Apache dosc are EXTENSIVE and so is the mysql doc pages a few THROUGH read through are a VERY good idea Apache http://httpd.apache.org/docs/2.2/ mysql http://dev.mysql.com/doc/ http://dev.mysql.com/doc/mysql-linux...tallation.html |
Dear Darth,
Have u set the root password of mysql after installing it? If no so don't pass the option -p in command. mysql -u root DBname < program.sql and for mysql login/console/prompt just type mysql adn hit enter key. i.e. [root@XLSGOPCP ~]# mysql powerxcat said right.....By default, the password for mysql root is blank. |
Hey powerxcat that fixed the issue, I appreciate it
|
Dear Darth,
Great.......... |
All times are GMT -5. The time now is 04:40 PM. |