On Monday 16 February 2009, Craig White wrote: >On Mon, 2009-02-16 at 14:06 -0500, Gene Heskett wrote: >> On Monday 16 February 2009, Craig White wrote: >> >---- >> >I think original setup for mysql is for root user via local socket and >> >not via localhost so there actually isn't an account for root@localhost >> >thus attempting to connect via tcp/ip as root is doomed to fail out of >> >the box. >> > >> >Craig >> >> With all due respect Craig, what the hell use is it then when ALL the >> documentation is wrong? >> >> Now, I just had the bright idea of looking at the mysqld.log after ripping >> it all out and putting even more of it back in, and see this: >> >> [root@coyote etc]# cat /var/log/mysqld.log >> 090216 13:30:36 mysqld ended >> >> 090216 13:30:45 mysqld started >> /usr/libexec/mysqld: Can't create/write to file '/tmp/ibnoIZas' (Errcode: >> 13) 090216 13:30:45 InnoDB: Error: unable to create temporary file; >> errno: 13 090216 13:30:45 [Note] /usr/libexec/mysqld: ready for >> connections. Version: '5.0.45' socket: '/var/lib/mysql/mysql.sock' port: >> 3306 Source distribution >> >> So obviously /tmp doesn't have the right perms. Or at least I assume >> (there is that word again) that an error 13 is permissions related. >> Selinux is in targeted mode, enabled, and it isn't fussing. >> >> /tmp itself is drwxr-xr-x amanda disk system_u:object_r:tmp_t:s0 >> tmp but nearly everything in it is root:root except the amanda and >> amanda-debug directories. So I just changed tmp to drwxrwxrwx But that >> also didn't change anything. Or did it, now the log shows this when I >> restart mysqld: >> >> 090216 13:51:44 mysqld started >> InnoDB: The first specified data file ./ibdata1 did not exist: >> InnoDB: a new database to be created! >> 090216 13:51:44 InnoDB: Setting file ./ibdata1 size to 10 MB >> InnoDB: Database physically writes the file full: wait... >> 090216 13:51:45 InnoDB: Log file ./ib_logfile0 did not exist: new to be >> created InnoDB: Setting log file ./ib_logfile0 size to 5 MB >> InnoDB: Database physically writes the file full: wait... >> 090216 13:51:45 InnoDB: Log file ./ib_logfile1 did not exist: new to be >> created InnoDB: Setting log file ./ib_logfile1 size to 5 MB >> InnoDB: Database physically writes the file full: wait... >> InnoDB: Doublewrite buffer not found: creating new >> InnoDB: Doublewrite buffer created >> InnoDB: Creating foreign key constraint system tables >> InnoDB: Foreign key constraint system tables created >> 090216 13:51:46 InnoDB: Started; log sequence number 0 0 >> 090216 13:51:46 [Note] /usr/libexec/mysqld: ready for connections. >> Version: '5.0.45' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source >> distribution >> >> Which says one problem seems to be sorted, at the expense of a huge >> security hole in /tmp as anyone can do anything there now. >> >> Ok, so now try a login again: >> [root@coyote /]# mysql -u root -p >> Enter password: >> ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using >> password: YES) [root@coyote /]# mysql -u root -p >> Enter password: >> ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using >> password: NO) [root@coyote /]# >> >> Seems like this is where I started, isn't it? >> >> Now that the tmp perms is sorted, I suppose I need to go back and do all >> that other stuff again... >> >> Which I just did, and didn't change a thing. WTF? >> Thanks Craig > >---- >after initial installation but before you actually ever start mysqld >service... > >mysqladmin - u root password 'new-password' > >*might* work after the mysqld service has already been started but if >you look at the script involved in /etc/init.d/mysqld, much will happen >the first time you start it. > >You can always stop mysqld service, empty contents of /var/lib/mysql and >start the service if you don't care about any of the setup. I didn't, but: [root@coyote /]# service mysqld stop STOPPING server from pid file /var/run/mysqld/mysqld.pid 090216 14:57:46 mysqld ended Stopping MySQL: [ OK ] [1]+ Done mysqld_safe --skip-grant-tables --init-file=/tmp/mysql.user [root@coyote /]# mysqladmin password 'xxxsanitized' mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists! [root@coyote /]# cd /var/lib [root@coyote lib]# ls alternatives cs dhclient hal kdm multipath pgsql rkhunter sepolgen texmf yum awstats dav dhcpv6 hsqldb logrotate.status mysql php rpcbind setroubleshoot vdr bittorrent dbus dirmngr htdig misc nfs PolicyKit rpm spamassassin webalizer bluetooth denyhosts games iptraf mlocate ntp random-seed samba stateless xkb [root@coyote lib]# rm -fR mysql [root@coyote lib]# mysqladmin password 'sanitized' mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists! [root@coyote lib]# service mysqld start Initializing MySQL database: Installing MySQL system tables... OK Filling help tables... OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password 'new-password' /usr/bin/mysqladmin -u root -h coyote.coyote.den password 'new-password' ================ Example: cd /usr ; /usr/bin/mysqld_safe & /usr/bin/mysqladmin -u root password 'new-password' /usr/bin/mysqladmin -u root -h coyote.coyote.den password 'new-password' /usr/bin/mysqladmin -u root -h localhost password 'new-password' Returns: /usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: NO)' ================ See the manual for more instructions. You can start the MySQL daemon with: cd /usr ; /usr/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd mysql-test ; perl mysql-test-run.pl ===================== I also did this, after updatedb and locating the stuff cd //usr/share/mysql-test [root@coyote mysql-test]# perl mysql-test-run.pl Logging: mysql-test-run.pl MySQL Version 5.0.45 Skipping ndbcluster, mysqld not compiled with ndbcluster Setting mysqld to support SSL connections Using MTR_BUILD_THREAD = 0 Using MASTER_MYPORT = 9306 Using MASTER_MYPORT1 = 9307 Using SLAVE_MYPORT = 9308 Using SLAVE_MYPORT1 = 9309 Using SLAVE_MYPORT2 = 9310 Using IM_PORT = 9312 Using IM_MYSQLD1_PORT = 9313 Using IM_MYSQLD2_PORT = 9314 Killing Possible Leftover Processes Removing Stale Files Creating Directories Installing Master Database Installing Master Database Installing Slave1 Database mysql-test-run: WARNING: running this script as _root_ will cause some tests to be skipped ======================================================= Starting Tests in the 'main' suite TEST RESULT TIME (ms) ------------------------------------------------------- mysql-test-run: WARNING: Process 21356 died alias [ fail ] ERROR: Failed to start master mysqld 0 Aborting: alias failed in default mode. To continue, re-run with '--force'. Stopping All Servers ========================== so, adding the --force I get about 2 megabytes of this before I ctl+C it. ERROR: Failed to start master mysqld 0 Stopping All Servers Restoring snapshot of databases Resuming Tests mysql-test-run: WARNING: Process 21713 died drop [ fail ] ERROR: Failed to start master mysqld 0 Stopping All Servers Restoring snapshot of databases Resuming Tests mysql-test-run: WARNING: Process 21716 died drop_temp_table [ fail ] ERROR: Failed to start master mysqld 0 =================== And back to the test.pl output below. Please report any problems with the /usr/bin/mysqlbug script! The latest information about MySQL is available on the web at http://www.mysql.com Support MySQL by buying support/licenses at http://shop.mysql.com [ OK ] Timeout error occurred trying to start MySQL Daemon. Starting MySQL: [FAILED] [root@coyote lib]# >As for the documentation...it's not wrong but the documentation doesn't >account for what the various distributions will do with their >initialization scripts. > >If it's all too much for you, install webmin and use that to >create/maintain user accounts in mysql. > >Craig [root@coyote etc]# yum install webmin Loaded plugins: upgrade-helper fedora | 2.1 kB 00:00 rpmfusion-free-updates | 2.7 kB 00:00 rpmfusion-nonfree-updates | 2.7 kB 00:00 rpmfusion-free | 951 B 00:00 updates-newkey | 2.3 kB 00:00 fedora-source | 2.1 kB 00:00 rpmfusion-nonfree | 951 B 00:00 updates-newkey-source | 2.1 kB 00:00 Setting up Install Process Parsing package install arguments No package webmin available. Nothing to do [root@coyote etc]# Real co-operative, that. Thanks Craig. I wonder if it would work on kubuntu-8.10? Anybody know? -- Cheers, Gene "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) What about WRITING it first and rationalizing it afterwords? :-) -- Larry Wall in <8162@xxxxxxxxxxxxxxxxxxxxxxx> -- fedora-list mailing list fedora-list@xxxxxxxxxx To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines