Apr 15
SuspenceMysql, Windows
reseting a mysql password on windows
1. stop mysql
2. Open a command prompt by selecting Start> run> typing in cmd
3. Changed directory to C:\program files\mysql\MySQL Server 5.1_orig\bin by running
cd “C:\program files\mysql\MySQL Server 5.1_orig\bin”
4. Started mysql from the command line with:
mysqld –defaults-file=”C:\Program Files\MySQL\MySQL Server 5.1\my.ini” –skip-grant-tables
5. Opened a 2nd command prompt
6. Changed directory to C:\program files\mysql\MySQL Server 5.1_orig\bin
7. log into mysql by typing
mysql
8. select the database
USE mysql
9. update the password
UPDATE user SET password=(‘ ‘) WHERE user=’root’;
10. exit mysql
11. kill the mysql service running in the first command prompt with
taskkill /F /IM mysqld.exe
12. Start mysql normally
13. from the command prompt or the mysql command line client connect to mysql
mysql -uroot -p
just hit enter for the password
14. update permissions
GRANT all on *.* to root@’localhost’ identified BY ‘newpassword’;
GRANT all on *.* to root@’%’ identified BY ‘newpassword’;
flush PRIVILEGES;
15. exited out of mysql
16. tested new password with
mysql -uroot -p
this time entering the password specified.
Apr 15
SuspenceMysql, Windows
A quick way to upgrade mysql on a windows server without using an installer
1. download the mysql-noinstall 32/64 bit version from mysql
2. stop mysql
3. Extract the folder to c:\program files\mysql
4. Renam the MySQL Server 5.1 folder to MySQL Server 5.1_orig
5. rename the extracted folder to MySQL Server 5.1
6. copy C:\program files\mysql\MySQL Server 5.1_orig\data to C:\program files\mysql\MySQL Server 5.1\data
7. copy C:\program files\mysql\MySQL Server 5.1_orig\my.ini to C:\program files\mysql\MySQL Server 5.1\my.ini
8. Start mysql
9. Open a command prompt by selecting Start> run> typing in cmd
10. Change directory to C:\program files\mysql\MySQL Server 5.1_orig\bin by running
cd “C:\program files\mysql\MySQL Server 5.1_orig\bin”
11. upgrade mysql by running
mysql_upgrade
This syncs up the databases with the newly installed version.
Apr 08
SuspenceLinux, Storegrid
partyly taken from
http://www.storegrid.com/forum/viewtopic.php?t=4608&sid=bcf279ac6a6d4e4f4687893715c60e3d
partly taken from
http://www.storegrid.com/forum/viewtopic.php?p=7516
to find out the problem with storegrid:
1) Stop StoreGrid if it is already running.
2) Open a command prompt and go to <STOREGRID_HOME> folder and start StoreGrid by executing the following command: “./bin/StoreGrid > sgoutput.txt”
to fix a corrupt database file
1. Stop StoreGrid
2. Open the terminal window and go to the location
“<StoreGrid_Installation_Dir>/lib/” and copy the ’sqlite.bin’ file to /home/storegrid/Vembu/StoreGrid/data folder.
3. Access the Database base file (sgserver.db) from command line, by executing “./sqlite.bin sgserver.db”.
4. Execute the command “pragma integrity_check;”
5. If the output is ‘ok’ then the database is not corrupted, if not then the database gets corrupted.
6. Quit sqlite application using “.q” command.
7. If sgserver.db is corrupted rename the sgserver.db file available in /home/storegrid/Vembu/StoreGrid/data/ folder to ’sgserver.db.corrupt’.
8. Access the Database base file (sgserver.db.bak) from command line, by executing “./sqlite.bin sgserver.db.bak”. If the output is ‘ok’ then please proceed with step 9 and step 10.
9. Take a another copy of ’sgserver.db.bak’ file and save it as ’sgserver.db.bak.ori’.
10. Copy the ’sgserver.db.bak’ file available in /home/storegrid/Vembu/StoreGrid/data/ folder and save it as ’sgserver.db’ in the same location.
the example I ran myself:
root@data]# ../lib/sqlite.bin sgclient.db
SQLite version 3.5.4
Enter “.help” for instructions
sqlite> pragma integrity_check;
SQL error: malformed database schema
replace database with backup
[root@data]# mv sgclient.db
sgclient.db sgclient.db.bak
[root@data]# mv sgclient.db sgclient.db_bad
[root@data]# cp -p sgclient.db.bak sgclient.db
start database & verify its running
[root@data]# /etc/init.d/storegrid start
Starting StoreGrid!
[root@data]# /etc/init.d/storegrid status
StoreGrid is running as pid 28613 pts/0 00:00:01 StoreGrid