LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-16-2009, 07:21 AM   #1
smaj84_1
Member
 
Registered: Jul 2009
Location: Pakistan
Distribution: Fedora
Posts: 71

Rep: Reputation: 15
MYSQL


Hi friends!

I m using fedora...while installing MYSQL on the following step...

Create mysql config file: cp support-files/my-medium.cnf /opt/var/my.cnf

Is it necessary to copy this file? When I try to copy this I received this message:
[root@localhost support-files]# cp -p my-medium.cnf /opt/var/my.cnf
cp: cannot create regular file `/opt/var/my.cnf': No such file or directory



Please guide me.

Last edited by smaj84_1; 08-16-2009 at 07:23 AM.
 
Old 08-16-2009, 07:29 AM   #2
ThinkFree
Member
 
Registered: Jan 2009
Location: India
Distribution: Fedora, Arch, OpenSolaris
Posts: 112

Rep: Reputation: 20
Are you sure /opt/var directory exists?
 
Old 08-16-2009, 07:32 AM   #3
smaj84_1
Member
 
Registered: Jul 2009
Location: Pakistan
Distribution: Fedora
Posts: 71

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by ThinkFree View Post
Are you sure /opt/var directory exists?
No, It does not exist...If I dont use this location then where I have to copy this file..
 
Old 08-16-2009, 07:43 AM   #4
ThinkFree
Member
 
Registered: Jan 2009
Location: India
Distribution: Fedora, Arch, OpenSolaris
Posts: 112

Rep: Reputation: 20
Haven't installed from source, but MySQL reference manual says
Quote:
2.10.1. Source Installation Overview
The basic commands that you must execute to install a MySQL source distribution are:
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> gunzip < mysql-VERSION.tar.gz | tar -xvf -
shell> cd mysql-VERSION
shell> ./configure --prefix=/usr/local/mysql
shell> make
shell> make install
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> cd /usr/local/mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> bin/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql var
shell> bin/mysqld_safe --user=mysql &
Means you have to copy the file in /etc/
 
Old 08-16-2009, 07:44 AM   #5
ThinkFree
Member
 
Registered: Jan 2009
Location: India
Distribution: Fedora, Arch, OpenSolaris
Posts: 112

Rep: Reputation: 20
But why aren't you using yum or mysql rpm for installation?
 
Old 08-16-2009, 07:49 AM   #6
smaj84_1
Member
 
Registered: Jul 2009
Location: Pakistan
Distribution: Fedora
Posts: 71

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by ThinkFree View Post
But why aren't you using yum or mysql rpm for installation?
how i use yum for installing mysql? I want mysql to work with php
 
Old 08-16-2009, 07:54 AM   #7
ThinkFree
Member
 
Registered: Jan 2009
Location: India
Distribution: Fedora, Arch, OpenSolaris
Posts: 112

Rep: Reputation: 20
Quote:
yum install mysql mysql-server
will install mysql client as well as mysql server.Add

yum install mysql mysql-server apache2 php
will let install LAMP
 
Old 08-17-2009, 03:34 AM   #8
smaj84_1
Member
 
Registered: Jul 2009
Location: Pakistan
Distribution: Fedora
Posts: 71

Original Poster
Rep: Reputation: 15
Problem with MySQL

While I try to start mysql it says FAILED.Cant connect to local MYSQL server through socket mysql.sock

then I did this to find mysql.sock

[root@localhost lib]# locate mysql.sock
/var/lib/mysql/mysql.sock
[root@localhost lib]# cd /
[root@localhost /]# cd /var
[root@localhost var]# cd lib
[root@localhost lib]# cd mysql
[root@localhost mysql]# ls
Ali ib_logfile0 localhost.localdomain.err mysql
ibdata1 ib_logfile1 test

Why mysql.sock is not listed ? Where is it?
 
Old 08-17-2009, 04:04 AM   #9
jrtayloriv
Member
 
Registered: Jun 2004
Location: Inland NW, US
Distribution: Ubuntu
Posts: 365
Blog Entries: 1

Rep: Reputation: 44
First of all, locate uses an index of your filesystem that is updated (usually via a cronjob) with updatedb. So /var/lib/mysql.sock did exist last time updatedb was run, which is why locate is finding it. But this doesn't mean that it exists now.

Second, you can just type cd /var/lib/mysql/ instead of cd'ing into each directory.

Finally, as far as mysql.sock, just restart your mysql service. Depending on your linux distro, you can do usually do this with one of the following commands:

1) /etc/init.d/mysqld restart

OR

1) /etc/rc.d/init.d/mysqld restart


If you tell us which distro you are using, we can tell you the exact command.

--jrtayloriv

Last edited by jrtayloriv; 08-17-2009 at 04:05 AM.
 
Old 08-17-2009, 05:26 AM   #10
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by smaj84_1 View Post
While I try to start mysql it says FAILED.Cant connect to local MYSQL server through socket mysql.sock

then I did this to find mysql.sock

[root@localhost lib]# locate mysql.sock
/var/lib/mysql/mysql.sock
[root@localhost lib]# cd /
[root@localhost /]# cd /var
[root@localhost var]# cd lib
[root@localhost lib]# cd mysql
[root@localhost mysql]# ls
Ali ib_logfile0 localhost.localdomain.err mysql
ibdata1 ib_logfile1 test

Why mysql.sock is not listed ? Where is it?
Are you starting mysql for the very first time??
have you recently upgraded it or made any changes??
This error should give you the exact path for the mysql.sock -

Code:
mysqladmin status
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!

above is an example on my server when i upgraded, because the new version runs from somewhere else, so i would need to specify

Code:
 --socket /path/to/mysql.sock


Code:
root      5039  0.0  0.1   4548  1296 ?        S    Jul06   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid
 
Old 08-17-2009, 05:33 AM   #11
smaj84_1
Member
 
Registered: Jul 2009
Location: Pakistan
Distribution: Fedora
Posts: 71

Original Poster
Rep: Reputation: 15
Thanks I have solved that issue..I have installed Wordpress and configured its wp-config-sample.pho file and renamed it to wp-config.php now I want to load WordPress directory files on my http:/192.168.129.108ort/ .... Sould I place all files of Wordpress's directory to htdocs? I m using fedora
 
Old 08-17-2009, 06:33 AM   #12
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by smaj84_1 View Post
Thanks I have solved that issue..I have installed Wordpress and configured its wp-config-sample.pho file and renamed it to wp-config.php now I want to load WordPress directory files on my http:/192.168.129.108ort/ .... Sould I place all files of Wordpress's directory to htdocs? I m using fedora
was i of any help?? if yes, thank me with currency that is even better then $$$$$$
a thumbs up....
 
Old 08-17-2009, 06:39 AM   #13
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by smaj84_1 View Post
Thanks I have solved that issue..I have installed Wordpress and configured its wp-config-sample.pho file and renamed it to wp-config.php now I want to load WordPress directory files on my http:/192.168.129.108ort/ .... Sould I place all files of Wordpress's directory to htdocs? I m using fedora


taken from

Code:
codex.wordpress.org/Installing_WordPress
Code:
  Famous 5-Minute Install

Here's the quick version of the instructions, for those that are already comfortable with performing such installations. More detailed instructions follow.

   1. Download and unzip the WordPress package, if you haven't already.
   2. Create a database for WordPress on your web server, as well as a MySQL user who has all privileges for accessing and modifying it.
   3. Rename the wp-config-sample.php file to wp-config.php.
   4. Open wp-config.php in your favorite text editor and fill in your database details as explained in Editing wp-config.php to generate and use your secret key password.
   5. Place the WordPress files in the desired location on your web server:
          * If you want to integrate WordPress into the root of your domain (e.g. http://example.com/), move or upload all contents of the unzipped WordPress directory (but excluding the directory itself) into the root directory of your web server.
          * If you want to have your WordPress installation in its own subdirectory on your web site (e.g. http://example.com/blog/), rename the directory wordpress to the name you'd like the subdirectory to have and move or upload it to your web server. For example if you want the WordPress installation in a subdirectory called "blog", you should rename the directory called "wordpress" to "blog" and upload it to the root directory of your web server.

            Hint: If your FTP transfer is too slow read how to avoid FTPing at : Step 1: Download and Extract. 
   6. Run the WordPress installation script by accessing wp-admin/install.php in your favorite web browser.
          * If you installed WordPress in the root directory, you should visit: http://example.com/wp-admin/install.php
          * If you installed WordPress in its own subdirectory called blog, for example, you should visit: http://example.com/blog/wp-admin/install.php 

That's it! WordPress should now be installed.
so, yes, i guess you can install in your docroot
 
Old 08-17-2009, 06:52 AM   #14
smaj84_1
Member
 
Registered: Jul 2009
Location: Pakistan
Distribution: Fedora
Posts: 71

Original Poster
Rep: Reputation: 15
Ok I have copy all files in htdocs directory...but now I m facing this problem

Warning: require_once() [function.require-once]: line number 76

and wp-config.php on line 76 is :

require_once(Mansoor/apache/htdocs/ '/wp-settings.php');

did I put somthing wrong in it?
 
Old 08-17-2009, 04:57 PM   #15
jrtayloriv
Member
 
Registered: Jun 2004
Location: Inland NW, US
Distribution: Ubuntu
Posts: 365
Blog Entries: 1

Rep: Reputation: 44
Try this instead:
Code:
require_once(Mansoor/apache/htdocs/wp-settings.php);
--jrtayloriv
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can MySQL log on via SSH/bash? mysql:x:27:101:MySQL Server:/var/lib/mysql:/bin/bash Ujjain Linux - Newbie 2 04-24-2009 03:21 PM
yum install php-mysql fails with mysql 5.1 - "Error: mysql conflicts with MySQL" rebelde Linux - Software 2 03-13-2009 11:32 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Newbie 1 06-23-2007 04:35 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 09:44 AM


All times are GMT -5. The time now is 06:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration