August 26, 2006

> Mysql root issues, cannot log into the database as root

by @ 11:35 am. Filed under MySQL Hosting Issues.

Hello,

If you face such error —–>

ERROR 1045: Access denied for user: ‘root@localhost’ (using password: NO).

Solution :

You have set a password on the root account. This is a good thing. Start mysql by:

mysql -p

and it will prompt for the password.

If you don’t know the password, you can re-run the /scripts/mysql_install_db script to rebuild the mysql database. You might need to delete the /data/mysql directory to do this, but I’m not positive.

Since you’ve just installed the server this shouldn’t disrupt any existing user/database relationships.

And if there’s no default password- just running “mysql” when logged into the server as root should get you in.

The method to change the password is (as root):
“update mysql.user set password=password(’newpass’) where user=’root’;”

Then try

” mysqladmin -u root -p password ” or ” mysqladmin -u user -ppassword ”

If you’re logged into the server as “root”, then the “-u root” is optional. Mysql will use the currently-logged-in userid unless told otherwise.

« Previous entries Next entries »

MySql sample my.cnf file

by @ 11:32 am. Filed under MySQL Hosting Issues.

[client]
port=3306
socket=/var/lib/mysql/mysql.sock

[mysqld]
port=3306
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

skip-locking
skip-innodb
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=500
interactive_timeout=100
wait_timeout=14400
connect_timeout=10
thread_cache_size=128
key_buffer=150M
join_buffer=1M
max_allowed_packet=16M
table_cache=1500
record_buffer=1M
sort_buffer_size=1M
read_buffer_size=1M
read_rnd_buffer_size=768K
max_connect_errors=10
thread_concurrency=4
myisam_sort_buffer_size=64M
log-bin
server-id=1

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/lib/mysql/********.pid [NOTE : here it should be server hostname]
open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash

[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout

« Previous entries Next entries »

Connecting to a MySQL database

by @ 11:28 am. Filed under MySQL Hosting Issues.

The ASP code below connects to a MySQL database, and produces a simple table output from the database.

” & whatever.name & “”
next
response.write ” ”
response.write cellstart & Name & “”
rstemp.movenext
LOOP
%>

From here you can easily modify the SELECT statement to look for specific results, much as you would from a Search box. So this modified SELECT statement:
mySQL=”select * from asptest where phone LIKE ‘555%’”
produces a subsection of the results from the first code example.

====================================

for more info visit
http://216.147.98.109/support_aspdb.html

=====================================

« Previous entries Next entries »

Webalizer Error :DBD::mysql::db do failed

by @ 11:27 am. Filed under MySQL Hosting Issues.

Error while running #/scripts/fixwebalizer can be fix.
————–
DBD::mysql:b do failed: Can’t open file: ’smtp.MYI’. (errno: 145) at /usr/local/cpanel/cpanellogd line 1924.
DBD::mysql::st execute failed: Can’t open file: ’smtp.MYI’. (errno: 145) at /usr/local/cpanel/cpanellogd line 1926.
DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/local/cpanel/cpanellogd line 1927.
DBD::mysql:b do failed: Can’t open file: ’smtp.MYI’. (errno: 145) at /usr/local/cpanel/cpanellogd line 1930.
DBD::mysql:b do failed: Can’t open file: ’smtp.MYI’. (errno: 145) at /usr/local/cpanel/cpanellogd line 1931.
DBD::mysql:b do failed: Can’t open file: ’sends.MYI’. (errno: 145) at /usr/local/cpanel/cpanellogd line 1932.
————–
You need to run following command on shell as a root user :
#myisamchk -r /var/lib/mysql/eximstats/smtp.MYI and this should fix the error. Once this is done run
#/scripts/runweblogs .

Please check following Cpanel thread for more help.
http://forums.cpanel.net/showthread.php?t=…%3Adb+failed%3A

« Previous entries Next entries »

Dumping Table Structure and Data

by @ 11:26 am. Filed under MySQL Hosting Issues.

Utility to dump a database or a collection of database for backup or for transferring the data to another SQL server (not necessarily a MySQL server). The dump will contain SQL statements to create the table and/or populate the table.
Syntax:
Code:
shell> mysqldump [OPTIONS] database [tables]
OR mysqldump [OPTIONS] –databases [OPTIONS] DB1 [DB2 DB3…]
OR mysqldump [OPTIONS] –all-databases [OPTIONS]

If you don’t give any tables or use the –databases or –all-databases, the whole database(s) will be dumped.
You can get a list of the options your version of mysqldump supports by executing
Code:
mysqldump –help.

Note that if you run mysqldump without –quick or –opt, mysqldump will load the whole result set into memory before dumping the result. This will probably be a problem if you are dumping a big database.
Note that if you are using a new copy of the mysqldump program and you are going to do a dump that will be read into a very old MySQL server, you should not use the –opt or -e options.
mysqldump supports the following options:
–add-locks

Add LOCK TABLES before and UNLOCK TABLE after each table dump. (To get faster inserts into MySQL.)
–add-drop-table
Add a drop table before each create statement.
-A, –all-databases
Dump all the databases. This will be same as –databases with all databases selected. -a, –all
Include all MySQL-specific create options.
–allow-keywords
Allow creation of column names that are keywords. This works by prefixing each column name with the table name.
-c, –complete-insert

Use complete insert statements (with column names).
-C, –compress
Compress all information between the client and the server if both support compression.
-B, –databases

To dump several databases. Note the difference in usage. In this case no tables are given. All name arguments are regarded as database names. USE db_name; will be included in the output before each new database.
–delayed Insert rows with the INSERT DELAYED command.
-e, –extended-insert
Use the new multiline INSERT syntax. (Gives more compact and faster inserts statements.)
-#, –debug[=option_string]
Trace usage of the program (for debugging).
–help
Display a help message and exit.
–fields-terminated-by=…
–fields-enclosed-by=…
–fields-optionally-enclosed-by=…
–fields-escaped-by=…
–lines-terminated-by=…
These options are used with the -T option and have the same meaning as the corresponding clauses for LOAD DATA INFILE.
-F, –flush-logs
Flush log file in the MySQL server before starting the dump.
-f, –force,
Continue even if we get a SQL error during a table dump.
-h, –host=..
Dump data from the MySQL server on the named host. The default host is localhost. -l, –lock-tables.
Lock all tables before starting the dump. The tables are locked with READ LOCAL to allow concurrent inserts in the case of MyISAM tables. Please note that when dumping multiple databases, –lock-tables will lock tables for each database separately. So using this option will not guarantee your tables will be logically consistent between databases. Tables in different databases may be dumped in completely different states.
-K, –disable-keys
/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and /*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output. This will make loading the data into a MySQL 4.0 server faster as the indexes are created after all data are inserted.
-n, –no-create-db
CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name; will not be put in the output. The above line will be added otherwise, if a –databases or –all-databases option was given.
-t, –no-create-info
Don’t write table creation information (the CREATE TABLE statement).
-d, –no-data
Don’t write any row information for the table. This is very useful if you just want to get a dump of the structure for a table!
–opt
Same as –quick –add-drop-table –add-locks –extended-insert –lock-tables. Should give you the fastest possible dump for reading into a MySQL server.
-pyour_pass, –password[=your_pass]
The password to use when connecting to the server. If you specify no `=your_pass’ part, mysqldump you will be prompted for a password.
-P port_num, –port=port_num
The TCP/IP port number to use for connecting to a host. (This is used for connections to hosts other than localhost, for which Unix sockets are used.)
-q, –quick
Don’t buffer query, dump directly to stdout. Uses mysql_use_result() to do this. -Q, –quote-names
Quote table and column names within “’ characters.
-r, –result-file=…
Direct output to a given file. This option should be used in MSDOS, because it prevents new line `\n’ from being converted to `\n\r’ (new line + carriage return).
–single-transaction
This option issues a BEGIN SQL command before dumping data from server. It is mostly useful with InnoDB tables and READ_COMMITTED transaction isolation level, as in this mode it will dump the consistent state of the database at the time then BEGIN was issued without blocking any applications. When using this option you should keep in mind that only transactional tables will be dumped in a consistent state, e.g., any MyISAM or HEAP tables dumped while using this option may still change state. The –single-transaction option was added in version 4.0.2. This option is mutually exclusive with the –lock-tables option as LOCK TABLES already commits a previous transaction internally.
-S /path/to/socket, –socket=/path/to/socket
The socket file to use when connecting to localhost (which is the default host).
–tables
Overrides option –databases (-cool.gif.
-T, –tab=path-to-some-directory
Creates a table_name.sql file, that contains the SQL CREATE commands, and a table_name.txt file, that contains the data, for each give table. The format of the `.txt’ file is made according to the –fields-xxx and –lines–xxx options. Note: This option only works if mysqldump is run on the same machine as the mysqld daemon, and the user/group that mysqld is running as (normally user mysql, group mysql) needs to have permission to create/write a file at the location you specify. -u user_name, –user=user_name
The MySQL user name to use when connecting to the server. The default value is your Unix login name.
-O var=option, –set-variable var=option
Set the value of a variable. The possible variables are listed below. Please note that –set-variable is deprecated since MySQL 4.0, just use –var=option on its own.
-v, –verbose
Verbose mode. Print out more information on what the program does.
-V, –version
Print version information and exit.
-w, –where=’where-condition’
Dump only selected records. Note that quotes are mandatory:
-X, –xml
Dumps a database as well formed XML
-x, –first-slave
Locks all tables across all databases.
“–where=user=’jimf’” “-wuserid>1″ “-wuserid backup-file.sql
You can read this back into MySQL with:
Code:
mysql database my_databases.sql
If all the databases are wanted, one can use:
Code:
mysqldump –all-databases > all_databases.sql

Mysql Database Import and Backup
Code:
Import database backup
./mysql -uUserName -pPassword DatabaseName /s/domainname.com/httpdocs/databasename.sql

Backup Table
./mysqldump -uUserName -pPassword DatabaseName TableName > /s/domainname.com/httpdocs/databasename.sql

« Previous entries Next entries »

reset root password for MYSQL

by @ 11:18 am. Filed under MySQL Hosting Issues.

access denied” error for root@localho

First, stop the mysqld,

/etc/rc.d/init.d/mysql stop

Then stop chkservd to keep it from interfering with mysqld while you work on it with

/etc/rc.d/init.d/chkservd stop

Start up mysqld , but, without the grant tables,

mysqld –skip-grant-tables -u mysql &

Then change the pass..

mysql -u root mysql UPDATE user SET Password=PASSWORD(’new_password’) WHERE user=’root’;
FLUSH PRIVILEGES;

Now restart mysql

*******************************************************************************************
If at all the mysql password is not set. You can do so using the following commands on shell to set a password to the user root for mysql
*******************************************
killall mysqld
/usr/libexec/mysqld -Sg –user=root &
mysql
USE mysql
UPDATE user
SET password=password(”your root password”)
WHERE user=”root”;
flush privileges;
exit;
killall mysqld
/etc/init.d/mysqld start

*************************************

** The command work for only the user root..

« Previous entries Next entries »

Mysql backup script

by @ 10:55 am. Filed under MySQL Hosting Issues.

#!/bin/sh
date=`date ‘+%m-%d-%y’` (This is if you need time date and year of the backup which is a must)
mysqldump -upva_test -ppva_test > /home/pva/mysql_backup/pva_test.$date.sql (This will take your mysql database backup)
chown pva:pva mysql_backup -R (This will change the ownership of the file as this script will create backup file with root as owner)

« Previous entries Next entries »

August 21, 2006

Mysql password reset..

by @ 11:25 am. Filed under MySQL Hosting Issues.

Hello,

Its easy to reset the password of mysql by going inside the mysql prompt but what if the mysql command doesnt take inside mysql prompt?

Well in that case just fire following command and you will be able to reset the mysql password.

first locate your mysql’s hostname.pid file then

kill `cat /mysql-data-directory/host_name.pid`
mysqld_safe –skip-grant-tables &
mysqladmin -u root flush-privileges password “newpassword”

New password will be the password that you want to set now.

Enjoy mysql …

« Previous entries Next entries »

RESELLER HOSTING | DEDICATED SERVER | PREMIUM HOSTING | VPS HOSTING

Micfo Hosting

Micfo International LLC Leading the hosting Industry with Cheap and Affordable Linux Web Hosting Packages.

internal links:

categories:

archives:

Services:

Micfo Hosting

Micfo, delivering the best cpanel web hosting with maximum reliability is our exclusive focus.
Micfo International LLC

search blog:

TOP 10 POSTS:

Pages:

General Links:

Syndicate

other:

35 queries. 0.138 seconds