Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Write an article for LinuxForums Today! Win Great Prizes!
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > Your Distro > Slackware Linux Help > How to use MySQL in slackware

Forgot Password?
 Slackware Linux Help   For help and Discussion about Slackware linux

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds
Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 01-20-2008   #1 (permalink)
Just Joined!
 
Join Date: Jan 2008
Posts: 3
How to use MySQL in slackware

I am a beginner and i have complete installation of slackware 11.0.i have mysql 5.0 as specified in the /var/log/packages as i could percieve .
when i enter the shell and type $ mysql
the error i am getting is
Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
. please give full commands as i am complete noob
ganesha is offline  



Reply With Quote
Old 01-20-2008   #2 (permalink)
Just Joined!
 
Join Date: Jan 2008
Posts: 3
i got this in one of the post but could not understand it The socket file needs to be created by the database server so when other applications open it, such as the mysql client, they end up talking to the server. You can try and run the mysql database as root (not a terribly good idea most of the time, but might demonstrate the fix). The best way to fix this is to create a mysql user to run the database server as and allow that user access to the /var/run/mysql directory.

If that doesn't work look for the "socket" line in my.cnf, the mysql configuration file. Update it to point to a location you can write to.
ganesha is offline   Reply With Quote
Old 01-26-2008   #3 (permalink)
Linux Engineer
 
Join Date: Oct 2007
Location: Tucson AZ
Posts: 979
I see it's been a few days since your post so you may have a solution by now. If not try this. Open a konsole(terminal), login as root and type: mysql_install_db.
Again, as root type: chown -R mysql.mysql /var/lib/mysql.
Also, as root type: /usr/bin/mysqld_safe --user=mysql &
Open a 2nd terminal and log in as root and type: ps -e | grep my
You should see some results if mysql is running.
At the root prompt type: mysql -u root and if you get the mysql prompt(mysql>) you are good.
You need to set a root passwd, so at the prompt (not mysql>) but root type:mysql -u root mysql and you should get the mysql> prompt. If so, type:
SET PASSWORD FOR root@localhost-PASSWORD('password');
If this is successful, you will be able to log in to mysql from the konsole by typing: mysql -u root -p. You can do this same procedure to create users so you are not using mysql as root. to do this, as root log in to mysql and type:
GRANT ALL PRIVILEGES ON *.* to name@localhost IDENTIFIED BY 'password' WITH GRANT OPTION;
There are options to set, you do not have to GRANT ALL but check the documentation.
yancek is offline   Reply With Quote
Old 01-31-2008   #4 (permalink)
Just Joined!
 
Join Date: Jan 2008
Posts: 1
I agree with yancek but you can easy do with:
$su root
#su mysql
and like mysql user type:
$mysql_install_db
etc...

I do not prefer to set a pass for mysql user account, but you can set access for user in /etc/sudoers (as root) for user or group,
for group power:
%power ALL=NOPASSWD:/bin/su mysql
and then like common user type:
$su mysql
and you will become mysql user.

p.s do not run mysql as root cos you making a files root.root perm. and only as a root you can edit them or use them. And using root account whitout reason is just bad administration.
onion is offline   Reply With Quote
Old 02-04-2008   #5 (permalink)
Linux Newbie
 
grishi_111's Avatar
 
Join Date: Oct 2007
Location: Jafarpur Sitharra(U.P.)/New Delhi, India
Posts: 171
Send a message via Yahoo to grishi_111
i think it should work......
Try this as root in a terminal
slapt-get --update && slapt-get --searcn cruxports4slack
if it finds the package then do
slapt-get --install cruxports4slack

as root in a terminal you need to do this
ports -u
That will take a while to complete. ... but when it finally does, execute this
ports -l | grep mysql
You will see this

opt/mysql
opt/mysql-python
opt/mysql-ruby

So you do this
cd /usr/ports/opt/mysql
Then to begin the build and install ... execute this command
pkgmk -d -i


mysql_install_db

start service
/etc/rc.d/mysqld start
After you start the service, you need to log into the mysql server. After you do that, then your shell will look like that

mysql -h localhost -uroot
__________________
Sorry, it was unintentional.
You should have told me at least once and i could have fix it.
thanks for reminding me.
grishi_111 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
A Newbie's Getting Started Guide to Linux
Learn the basics of the Linux operating systems. Get to know what it is all about, and familiarize yourself with the practical side. Basically, if you're a complete Linux newbie and looking for a quick and easy guide to get you started this is it.
subscribe
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 05:11 PM.






© 2000 - - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.1