|
|||
Macam ni, saya tengah buat satu projek berkenaan document database, masalah skarang ni yelah, saya guna gabungan php, apache & mySQL, & tambahn TCL\TK script ni. sebelum install TCL/TK ni mmg x de masalah. saya boleh browse ke fail2 dlm apache. sampaila bila saya install TCL, & ubah skit conf file dlm apache, bila nak browse phpmyadmin, keluar la msg " Access denied for user 'root@localhost'(Using Password:NO)". sebab dah keluar msg tu yg buat saya tak dpt nak access mysql. so now ni saya mmg x tau nak buat mcm maner dah..adaer saper2 boleh tolong tak?
|
|
|||
|
|||
Mr. Sufyan, ni dia coding TCL tu.
Saya dpt coding ni dr internet dan saya x paham coding utk set root password. Maybe problem saya tu punca nyerr dari situ.. #!/usr/bin/wish # # initdb.tcl if {$tcl_platform(platform) == "windows"} { load fbsql.dll } else { load fbsql.so } set props {titl 0 0 file 0 0 dirn 0 0 isdi 0 0 deep 0 0 crea 0 0 auth 1 0 proj 1 1 type 1 1 keyw 2 0 refe 0 0} proc try_connect {user password} { if {[catch {sql connect localhost $user $password} err]} { if {[string match "*connect*" $err]} { return connect } else { return pass } } else { return ok } } proc request_password {} { global pass_entry pass_enter set pass_entry "" set pass_enter 0 label .label -text "Enter password for root :" entry .entry -textvariable pass_entry frame .frame button .frame.enter -width 6 -text "OK" -command {set pass_enter 1} button .frame.cancel -width 6 -text "cancel" -command {exit 0} pack .label .entry .frame -side top -padx 5 -pady 5 pack .frame.enter .frame.cancel -side left -padx 5 tkwait variable pass_enter destroy .label .entry .frame return $pass_entry } proc request_new_password {} { global pass_entry pass_enter set pass_entry "" set pass_enter 0 label .label -text "Enter a new password for root :" entry .entry -textvariable pass_entry frame .frame button .frame.enter -width 6 -text "OK" -command {set pass_enter 1} button .frame.cancel -width 6 -text "cancel" -command {exit 0} pack .label .entry .frame -side top -padx 5 -pady 5 pack .frame.enter .frame.cancel -side left -padx 5 tkwait variable pass_enter destroy .label .entry .frame return $pass_entry } proc request_connection {} { global pass_enter set pass_enter 0 label .label -text "Check that mysql is running" frame .frame button .frame.enter -width 6 -text "OK" -command {set pass_enter 1} button .frame.cancel -width 6 -text "cancel" -command {exit 0} pack .label .frame -side top -padx 5 -pady 5 pack .frame.enter .frame.cancel -side left -padx 5 tkwait variable pass_enter destroy .label .frame } proc init {} { global props set try "init" set rootpass "" set change_pass 0 set root_conn 0 while {$try != "ok"} { set try [try_connect root $rootpass] if {($try == "ok")&&($rootpass == "")} { set change_pass 1 } if {$try == "ok"} { set root_conn 1 } if {$try == "pass"} { set try [try_connect db_user db_pass] } if {$try == "pass"} { set rootpass [request_password] } elseif {$try == "connect"} { request_connection } } if {$change_pass == 1} { set new_pass [request_new_password] sql selectdb mysql sql "UPDATE user SET password=password('$new_pass') where user='root'" } if {$root_conn == 1} { sql selectdb mysql sql "DELETE FROM user WHERE user=''" sql "DELETE FROM user WHERE user='db_user'" sql "INSERT INTO user (Host, User, Password) VALUES('localhost', 'db_user', PASSWORD('db_pass'))" sql "DELETE from db where user='db_user'" sql "INSERT INTO db VALUES('localhost', 'documents_db', 'db_user', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y')" } sql "drop database if exists documents_db" sql "create database documents_db" sql selectdb documents_db foreach {prop proptype sublist} $props { if {$sublist == 1} { sql [format "create table %s (id int unsigned primary key auto_increment not null, opt varchar(30))" $prop] sql [format "create table %s_2 (id int unsigned primary key auto_increment not null, opt varchar(30))" $prop] } } sql "create table documents(id int unsigned primary key auto_increment not null, titl varchar(80), dirn varchar(100), file varchar(60), deep int unsigned, isdi int, crea date, auth varchar(80), refe varchar(50), proj int unsigned, type int unsigned, keyw varchar(80))" sql "create table documents_2(id int unsigned primary key auto_increment not null, titl varchar(80), dirn varchar(100), file varchar(60), deep int unsigned, isdi int, crea date, auth varchar(80), refe varchar(50), proj int unsigned, type int unsigned, keyw varchar(80))" sql "create table scan_dirs (id int unsigned primary key auto_increment not null, dir varchar(100),mapto varchar(100))" sql "insert into scan_dirs values (null, 'documents', 'documents')" } init label .lab -text "Database initialised" button .ok -text "ok" -command {exit 0} pack .lab .ok -side top -padx 10 -pady 10 |
|
|||
Well, I think you either:
1) Left the password blank or 2) Typed something wrong. The script should work because of these lines: if {$tcl_platform(platform) == "windows"} { load fbsql.dll which loads the tcl libraries Anyway, I think it's safe to say that you have lost your root password. The only 2 thing I can think of is reinstalling MySQL or resetting the root password. I would suggest you try resseting the password first, then if it doesn't work, you will have to reinstall MySQL. But, lets just hope that we can reset the mysql password. I'll try to make the steps as easy as possible to follow, but if you don't understand or have a question, please ask. 1) Ensure that the mysql deamon is loaded. From the MySQL bin directory, (eg. C:\mysql\bin) try typing mysqladmin version if it there is no error, mysql is loaded correctly. If theres an error, type mysqld from the came path and try to do the above again. If you cannoth find your bin directory, try using windows search to find the file: mysqladmin.exe 2) In the same directory as the mysqladmin.exe, type mysql -u root Some stuff should come out with 'mysql>'. If you see this, move on to step 3. 3) Type the following in mysql>, with an <ENTER> after each line. Ignore lines with # infront of them, these are just comments. use mysql; delete from user where user='root'; show fields from user; insert into user values ('localhost', 'root', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', '', '', '', '', 0, 0, 0); # the above is all on one line. flush privileges; exit mysqladmin -u root -p shutdown mysqld That's it, this 'should' reset your mysql root password. When resetted, root has NO password. Now, just open up the config file for PhpMyAdmin and ensure that the user is 'root' and password is left blank. If there are any errors, post them here. Also include your version of mySQL. I'm currently running 4.0.12-max-debug on WinXP. To find out your version, type mysqladmin version. Hope this helps, good luck! Last edited by sufyan; 08-09-2003 at 04:13 PM. |
|
|||
Just curious, what do you use TCL/Tk for? If it's just to set a root password, using mysqladmin is much, much easier...
Quote:
Anyway, give the reset password thing a go and see what happens. |
|
||||
i dah try, and its work. tq very much but i solve one problem by creating another problem..now ni I x boleh plak access mysql console...dia cakap cam ni " Access denied for user ODBC@localhost (Using Password: No)...tapi i malas nak pening2kan kepala, i reinstall phptriad and i settlekan create table barulah i continue buat TCL..
|
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Freelance ASP,PHP,ASP.Net,C#,ColdFusion,Action Scripting Developer and SEO | serviceatclick | Job Vacancies | 0 | 16-11-2006 07:06 AM |
| scripting for internal access | hankitae | Website Design | 3 | 10-03-2005 05:52 PM |
All times are GMT +8. The time now is 10:00 AM.
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.











Linear Mode

