Qs.i have a new database called 'jabb' and i want install the dump file 'sample.sql' into it?.. ive tried mysqldump --opt jabb > sample.sql but when i chek jabb, there aren't no tables.. do i still have to make the tables before dumping?
Ans:
mysqldump jabb -u [username] -p > sample.sql
Should export the table jabb from mysql to SQL syntax in a file called sample.sql. (if this isn't what you wanted to do you may have to get a fresh file.) open this file:
gedit sample.sql (I'd use vim sample.sql)
And check that the file contains the table.
The command for importing a dump is something like
mysql jabb -u[username] -p < sample.sql
If that doesn't work then I think you must not have mysql users set up correctly (check out the mysql manual - it's actually
Source: http://ubuntuforums.org/showthread.php?t=598130
Sunday, August 14, 2011
Getting started with mysql on linux
Getting started with MySQL is really easy. First you want to install the mysql server. Then you can start the server with this command:
Code:
sudo /etc/init.d/mysql start
Then, because intially the root user has no password, we want to set the password like this:
Code:
mysqladmin -u root password myPassword
You can now login to the mysql server with this:
Code:
mysql -u root -p
You'll need to type in the password that you entered earlier.
Every new MySQL install has 2 databases: mysql and test. Do NOT screw up your mysql database because here is where all the permission and user info is. The test DB is for you to play around with.The MySQL documentation is excellent. You'll probably want to set up a new user next. The MySQL docs can help you there.
Source: http://ubuntuforums.org/showthread.php?t=13245
Error: #mysqladmin -u root password root123
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
ANS:
This error normally comes when you have already set the root password and forgot it. So just change the root password by following method:
1. Stop the MySQL Server.
sudo /etc/init.d/mysql stop
2. Start the mysqld configuration.
sudo mysqld --skip-grant-tables &
3. Open a new tab and
Login to MySQL as root.
mysql -u root mysql
4. Replace YOURNEWPASSWORD with your new password!
UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit;
5. Now stop the mysqld by pressing Ctr + C and start mysql by following command
/etc/init.d/mysql start
6. login to the mysql server with this new Password:
mysql -u root -p
Enter Password.
Note: This method is not regarded as the securest way of resetting the password. However it works.
References
MySQL 5.0 Reference Manual: How to Reset the Root Password
Code:
sudo /etc/init.d/mysql start
Then, because intially the root user has no password, we want to set the password like this:
Code:
mysqladmin -u root password myPassword
You can now login to the mysql server with this:
Code:
mysql -u root -p
You'll need to type in the password that you entered earlier.
Every new MySQL install has 2 databases: mysql and test. Do NOT screw up your mysql database because here is where all the permission and user info is. The test DB is for you to play around with.The MySQL documentation is excellent. You'll probably want to set up a new user next. The MySQL docs can help you there.
Source: http://ubuntuforums.org/showthread.php?t=13245
Error: #mysqladmin -u root password root123
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
ANS:
This error normally comes when you have already set the root password and forgot it. So just change the root password by following method:
1. Stop the MySQL Server.
sudo /etc/init.d/mysql stop
2. Start the mysqld configuration.
sudo mysqld --skip-grant-tables &
3. Open a new tab and
Login to MySQL as root.
mysql -u root mysql
4. Replace YOURNEWPASSWORD with your new password!
UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit;
5. Now stop the mysqld by pressing Ctr + C and start mysql by following command
/etc/init.d/mysql start
6. login to the mysql server with this new Password:
mysql -u root -p
Enter Password.
Note: This method is not regarded as the securest way of resetting the password. However it works.
References
MySQL 5.0 Reference Manual: How to Reset the Root Password
Sunday, June 19, 2011
how to redirect your blog to your website
just paste this into the head of your template on blogger:
<\meta HTTP-EQUIV="REFRESH" content="0; url=http://bradsblog.net/">
"content" = number of seconds to wait before redirect
Note: please remove the existing backward slash before word meta.
<\meta HTTP-EQUIV="REFRESH" content="0; url=http://bradsblog.net/">
"content" = number of seconds to wait before redirect
Note: please remove the existing backward slash before word meta.
Friday, May 27, 2011
Tuesday, May 10, 2011
Thursday, May 5, 2011
Subscribe to:
Posts (Atom)