Ubuntu and Linux

For complex topics that regular users would not be interested in. For power users and database administrators.
Post Reply
abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Ubuntu and Linux

Post by abelaguilar » Mon Oct 01, 2007 12:51 pm

Can someone post detailed steps to installing and setting up mysql and mysql admin GUI for ubuntu?

I will try sudo apt-get install mysql-admin

I need to know how to create the database with the proper file permision changes to the folder.

I have successfully setup file and folder sharing with windows computers using Samba.
Abel Aguilar, DMD
http://www.DrAguilar.com

User avatar
wjstarck
Posts: 936
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Post by wjstarck » Mon Oct 01, 2007 1:59 pm

Well, Frederik Carlier is the Resident OD Ubuntu Guru (TM), so I would follow his instructions here:

http://opendental.carlier-online.be/using.html

As for the file ownership needed to run the database correctly do:

sudo chown -R mysql:mysql /var/lib/mysql/opendental

Otherwise, you might want to post what you've done and what problems you're having so we can help you better...

Cheers,

Bill Starck, DDS

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Mon Oct 01, 2007 2:22 pm

thanks I will give it a try
Abel Aguilar, DMD
http://www.DrAguilar.com

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Mon Oct 01, 2007 4:25 pm

ok here is what i've accomplished:

I have mysql running. I backed up a sample database from windows using mysql admin and restored in mysql admin in ubuntu.

I can see all my tables.

samba is setup and I can access files and folders from windows.

However, I cannot ssh into the linux box nor can I access the linux database by using mysql admin from within windows.

any suggestions?

I can ping the address of the linux box.
Abel Aguilar, DMD
http://www.DrAguilar.com

User avatar
wjstarck
Posts: 936
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Post by wjstarck » Mon Oct 01, 2007 8:34 pm

Sounds to me that either

a) ssh is not installed

or, more likely,

b) your firewall is blocking traffic on port 22 (and the ports Samba uses- 137, 139, 445) and/or

c) your sshd_config file is not set up to allow users to login via ssh

Let me know if you need help figuring out which of the above it is

Cheers,

Bill Starck, DDS

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Mon Oct 01, 2007 9:37 pm

yes got ssh running.

still having a file folder permission problem.

I did try your chown command but still open dental can connect to sql but then I get a file permission error.

I need to give any computer on the network full access to the database

any suggestions?

Thanks this is fun stuff
Abel Aguilar, DMD
http://www.DrAguilar.com

User avatar
wjstarck
Posts: 936
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Post by wjstarck » Tue Oct 02, 2007 6:28 am

Try this and report back:

sudo chown -R mysql:mysql /var/lib/mysql/

Cheers,

Bill Starck, DDS

User avatar
wjstarck
Posts: 936
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Post by wjstarck » Tue Oct 02, 2007 6:29 am

Also, make sure you restart mysql after any changes. Sometimes you may need to reboot as well.

sudo service mysql restart

Cheers,

Bill Starck, DDS

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Tue Oct 02, 2007 2:15 pm

Bill :

Had mysql running yesterday on the server. Turned off the computer. turned it on today and now ther service is not starting up.

This is what kills me about linux.

anyways, when I try to manually connect to mysql I get the typical mysqld.sock error.

"ERROR 2002 (HY000) Can't connect to local mysql server throught socket '/var/run/mysqld/mysqld.sock' (2)".

any suggestions?

thanks
Abel Aguilar, DMD
http://www.DrAguilar.com

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Tue Oct 02, 2007 2:19 pm

Bill: I get an error when using sudo service mysql restart. it says command not found.
Abel Aguilar, DMD
http://www.DrAguilar.com

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Tue Oct 02, 2007 4:10 pm

ok removed and reinstalled mysql server. and its running again.

I just don't know how to fix this sock error when I get it so I just reinstall.

mysql is back up and running and I can see my database opendenta.

again typing

sudo chown -R mysql:mysql /var/lib/mysql/

does not allow me to connect.

i think its a permission problem but I can't seem to solve it.

How do I give user abelaguilar full access to the database opendental?
Abel Aguilar, DMD
http://www.DrAguilar.com

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Tue Oct 02, 2007 4:41 pm

just thought of something:

in samba i'm sharing my opendental folder that will store all images. Does the mysql folder somewhere else need access via samba?

In other words do I need to share the mysql folder so that windows can access it via samba?
Abel Aguilar, DMD
http://www.DrAguilar.com

User avatar
wjstarck
Posts: 936
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Post by wjstarck » Tue Oct 02, 2007 6:41 pm

Hello-

Please do the following and post the output:

$cd /var/lib/mysql
$ls -l

mine looks like

-rw-r--r-- 1 root root 0 2007-09-24 17:55 debian-5.0.flag
-rw-r--r-- 1 root root 380 2007-10-02 20:33 FreeDentalConfig.xml
-rw-rw---- 1 mysql mysql 10485760 2007-10-02 20:32 ibdata1
-rw-rw---- 1 mysql mysql 5242880 2007-10-02 20:32 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 2007-09-24 17:55 ib_logfile1
drwxr-xr-x 2 mysql mysql 4096 2007-10-02 20:32 mysql
-rw------- 1 root root 6 2007-09-24 17:55 mysql_upgrade_info
drwxr-xr-x 2 mysql mysql 20480 2007-09-24 17:57 opendental

That should tell us if the uid, gid and permissions are set properly.

Cheers,

Bill Starck, DDS

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Tue Oct 02, 2007 7:25 pm

total 20540
-rw-r--r-- 1 mysql mysql 0 2007-10-02 18:52 debian-5.0.flag
-rw-rw---- 1 mysql mysql 10485760 2007-10-02 20:37 ibdata1
-rw-rw---- 1 mysql mysql 5242880 2007-10-02 20:44 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 2007-09-30 00:59 ib_logfile1
drwx------ 3 mysql mysql 4096 2007-10-02 20:44 mysql
-rw------- 1 mysql mysql 4 2007-09-30 00:59 mysql_upgrade.info
drwx------ 2 mysql mysql 12288 2007-10-02 00:29 opendental
abelaguilar@ubuntu:/var/lib/mysql$
Abel Aguilar, DMD
http://www.DrAguilar.com

User avatar
wjstarck
Posts: 936
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Post by wjstarck » Tue Oct 02, 2007 7:47 pm

Try this:

Code: Select all

$cd /var/lib/mysql
$sudo chmod 755 -R opendental
$service mysql restart
Let me know if that does it for you,

Bill Starck, DDS

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Wed Oct 03, 2007 3:54 am

still no luck.

When I set in open dental the server as ubuntu and the database as opendental, it seems to connect.

howver, it needs to modify the database becuase the version on my computer is different from the version that is stored in mysql.

that's when I get this error

access denied for user 'abelaguilar'@'192.168.0.101' to database 'opendentalbackup_10_03_07
Abel Aguilar, DMD
http://www.DrAguilar.com

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Post by Justin Shafer » Wed Oct 03, 2007 5:18 am

I bet your having grant table problems... go to /etc/mysql/my.cnf and add skip-grant-tables into [mysqld] section of the /etc/my.cnf file then restart mysql and give it a shot

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Wed Oct 03, 2007 5:47 am

ok i'll try that.

any other ways to get mysql to restart. I can't use the sudo service mysql restart command. It says that command is not available. i'll have to restart the computer since I have no other way.
Abel Aguilar, DMD
http://www.DrAguilar.com

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Wed Oct 03, 2007 6:34 am

I made the change and added skip-grant-tables to the mysqld section .

still can't get access

here is the output to the folder permission.


abelaguilar@ubuntu:/var/lib/mysql$ ls -l
total 20540
-rw-r--r-- 1 mysql mysql 0 2007-10-02 18:52 debian-5.0.flag
-rw-rw---- 1 mysql mysql 10485760 2007-10-03 09:20 ibdata1
-rw-rw---- 1 mysql mysql 5242880 2007-10-03 09:21 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 2007-09-30 00:59 ib_logfile1
drwx------ 3 mysql mysql 4096 2007-10-03 09:21 mysql
-rw------- 1 mysql mysql 4 2007-09-30 00:59 mysql_upgrade.info
drwxr-xr-x 2 mysql mysql 12288 2007-10-02 00:29 opendental
abelaguilar@ubuntu:/var/lib/mysql$

I can access the database tables using mysqladmin from within windows. its just when opendental tried to make changes by updating the database, that I get the denied access error.
Abel Aguilar, DMD
http://www.DrAguilar.com

fcarlier
Posts: 75
Joined: Tue Jun 19, 2007 3:12 am
Location: Ghent, Belgium

Post by fcarlier » Wed Oct 03, 2007 9:00 am

Can you modify the data from Windows? If not, your user (root@* or whatever) probably has read-only access.
Frederik Carlier

User avatar
wjstarck
Posts: 936
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Post by wjstarck » Wed Oct 03, 2007 9:44 am

Let's back up:

Is the database running on Windows or Linux (i.e., are you trying to use the Linux box as a client or server)?

What is the error message you get when you try to use the command

Code: Select all

$sudo service mysql restart
???

Cheers,

Bill Starck, DDS

fcarlier
Posts: 75
Joined: Tue Jun 19, 2007 3:12 am
Location: Ghent, Belgium

Post by fcarlier » Wed Oct 03, 2007 10:55 am

An alternative way to restart mysql is

Code: Select all

sudo /etc/init.d/mysql restart
Frederik Carlier

User avatar
wjstarck
Posts: 936
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Post by wjstarck » Wed Oct 03, 2007 11:38 am

If you want to start with the service command, you need to install a package called sysvconfig

Do this:

Code: Select all

$sudo apt-get install sysvconfig
to install sysvconfig

Then you should be able to

Code: Select all

$sudo service mysql start
to start mysql

Code: Select all

$sudo service mysql stop
to stop mysql, or

Code: Select all

$sudo service mysql restart
to restart mysql

HTH,

Bill Starck, DDS

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Wed Oct 03, 2007 1:12 pm

i'll have to install the service package. I know i've not done that which explains why the command won't work.

mysql database is on my ubuntu box. I can connect to it from my windows mysql admin program.
Abel Aguilar, DMD
http://www.DrAguilar.com

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Wed Oct 03, 2007 1:14 pm

ok great service package installed and I can start and stop mysql.

you would think ubuntu has this already installed.
Abel Aguilar, DMD
http://www.DrAguilar.com

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Wed Oct 03, 2007 1:35 pm

Frederick:

you mentioned can I modify the data from within windows. I could possibly try to add a table using mysqladmin in windows and see if it allows me to do that.

I think this is an issue with permission, but I can't seem to find the solution. If you look at earlier posts, you'll see where I posted the exact error message when open dental connects to the database and tries upgrade to the version of opendental that is on ubuntu.
Abel Aguilar, DMD
http://www.DrAguilar.com

fcarlier
Posts: 75
Joined: Tue Jun 19, 2007 3:12 am
Location: Ghent, Belgium

Post by fcarlier » Wed Oct 03, 2007 1:50 pm

So, you can connect to the database

"opendentalbackup_10_03_07" on your Ubuntu machine from your Windows machine.

What I would like you to do is try and execute the following statement on your Windows machine:

Code: Select all

CREATE TABLE Test
(
   TestId       int     NOT NULL
)
followed by

Code: Select all

INSERT INTO Test VALUES (1)
This tries to create a new table in the database and insert a value to this database.

Can you give me the output?
Frederik Carlier

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Wed Oct 03, 2007 2:31 pm

OK where do you want me to enter and create this query? mysadmin has a component that allows you to create queries called mysqlquerybrowser.
Abel Aguilar, DMD
http://www.DrAguilar.com

User avatar
wjstarck
Posts: 936
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Post by wjstarck » Wed Oct 03, 2007 2:39 pm

Abel-

I'm curious - can you do a

Code: Select all

$cd /var/lib
$sudo chmod 755 -R mysql
$sudo service mysql restart
and let me know what that does (don't worry, we can change the file permissions back to what they were later)?

Cheers,

Bill Starck, DDS
Last edited by wjstarck on Wed Oct 03, 2007 3:18 pm, edited 2 times in total.

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Wed Oct 03, 2007 2:48 pm

Yes I was able to input these commands and restart mysql
Abel Aguilar, DMD
http://www.DrAguilar.com

User avatar
wjstarck
Posts: 936
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Post by wjstarck » Wed Oct 03, 2007 3:08 pm

Are you able to connect to the database now, or no?

Bill Starck, DDS

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Wed Oct 03, 2007 3:33 pm

no cannot connect.

maybe I over complicted things but here is what I did.
I backedup my existing opendental database in windows.

then copied it over to ubuntu. Restored that backup using mysql admin.

then go into opendental, select the ubuntu server and then the database which is called opendental in ubuntu's mysqladmin
Abel Aguilar, DMD
http://www.DrAguilar.com

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Wed Oct 03, 2007 3:34 pm

no cannot connect.

maybe I over complicted things but here is what I did.
I backedup my existing opendental database in windows.

then copied it over to ubuntu. Restored that backup using mysql admin.

then go into opendental, select the ubuntu server and then the database which is called opendental in ubuntu's mysqladmin
Abel Aguilar, DMD
http://www.DrAguilar.com

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Wed Oct 03, 2007 4:18 pm

ok update

I redid the backup from an empty opendental database. ( no patients in list) and restored to mysql in ubuntu and set opendental to point to that mysql database and i worked.

now I will try an old REAL backup with all my real patients to see if that works.
Abel Aguilar, DMD
http://www.DrAguilar.com

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Wed Oct 03, 2007 4:34 pm

How would you guys recommend transfering my current windows mysql backup to my linux mysql server
Abel Aguilar, DMD
http://www.DrAguilar.com

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Wed Oct 03, 2007 5:04 pm

FINALLY!!!

ok guys, I finally got everything running. now what inthe world happened?

I think the problem was in the database backup that I made. restoring and backing up somehow got messed up.

I went ahead and re did a backup and restore into ubuntu and was able to access everything.

Now if I could only remember all I did!!! I have a pretty good idea.

My concirn with using this linux server is, if something happens and this server crashes, it will take me longer to be up and running. and it will be hard to find support.

I would like to keep my windows 2003 server and an additional linux server and have both mirror each other or at least backup from one to the other every night.

thanks again to all of you. I've said it before I LOVE AND HATE LINUX.

by the way I have a cool linux box "untangle.com" that keeps my staff from wondering all over the internet, email, spam and other free fileters. check it out.
Abel Aguilar, DMD
http://www.DrAguilar.com

User avatar
wjstarck
Posts: 936
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Post by wjstarck » Thu Oct 04, 2007 7:30 am

OD on Ubuntu is not yet stable enough to be used in a production environment.

It is coming along quite nicely, though :P

As for Linux, it just keeps getting better all the time - but it's definitely not for the faint of heart! It's greatest strength, which is complete customization, is also its greatest weakness, especially if you have been a long time Windows or Mac user, and are used to a more packaged (and perhaps less customizable) approach. The point is that Windows, Mac OS X and Linux are all great platforms, each with their respective strengths and weaknesses.

As always when you run into a problem with Linux, Google is your friend. I have yet to run across a problem I couldn't solve with a few minutes of good Googling.

Good luck, ask a lot of questions, have fun!

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Thu Oct 04, 2007 1:22 pm

thanks again for all your help

Question: I feel like the ubuntu distribution was missing many packages that came with others like suse.

Is there a preference as far as distributions go?
Abel Aguilar, DMD
http://www.DrAguilar.com

User avatar
wjstarck
Posts: 936
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Post by wjstarck » Thu Oct 04, 2007 1:24 pm

SUSE typically uses KDE desktop.

Are you referring to all the KDE programs?

Bill Starck, DDS

fcarlier
Posts: 75
Joined: Tue Jun 19, 2007 3:12 am
Location: Ghent, Belgium

Post by fcarlier » Thu Oct 04, 2007 1:36 pm

On Ubuntu, a small subset of programs is fully supported. That means that you could call Canonical (the company behind Ubuntu) and ask them for support for these programs (given that you bought support plan). Examples of these programs include Firefox and OpenOffice.org, amongst others.
Another difference is that these programs get regular security updates. We say that these packages are in the "main" repository.

Other packages are still included with Ubuntu, but they are said to be part of the "universe" (or "multiverse"). You have to enable the usage of these packages in Ubuntu. See http://www.ubuntu.com/community/ubuntustory/components for more information.

This may explain why you feel some packages are missing. As said, if you look for the KDE applications, you should try out KUbuntu.

Another difference is that Suse comes with a lot of packages that do *the same thing* pre-installed. If I recall correctly, you get about three or four console programs pre-installed with Suse. Personally, I prefer Ubuntu because it comes with exactly *one* console program pre-installed. That makes it easier for me to use.

I have a strong perference for Ubuntu, but I know Dr. Sparks uses Open Suse, for example.
Frederik Carlier

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Thu Oct 04, 2007 1:51 pm

interesting. I don't have a problem working with ubuntu. I just don't want to find out later that I should have been using something else.

Also, any suggestions on how I can bring my opendental backup from work and quickly restore to ubuntu to make sure my backups are working?

In windows its just a matter of copying the files over.
Abel Aguilar, DMD
http://www.DrAguilar.com

User avatar
jordansparks
Site Admin
Posts: 5740
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Post by jordansparks » Fri Oct 05, 2007 7:52 am

Restoring onto a Linux computer works the same way.
1. Stop the MySQL server (Linux lingo for service). I use Webmin for this.
2. Rename the old opendental.
3. Copy the backup to Linux.
4. Change file permissions.
5. Start the server.
Jordan Sparks, DMD
http://www.opendental.com

abelaguilar
Posts: 87
Joined: Tue Jun 19, 2007 3:26 pm
Location: Manchester, GA
Contact:

Post by abelaguilar » Fri Oct 05, 2007 8:21 am

OH really? I thought I had to use mysql admin to backup the database and then restore using mysql admin.
Abel Aguilar, DMD
http://www.DrAguilar.com

User avatar
jordansparks
Site Admin
Posts: 5740
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Post by jordansparks » Fri Oct 05, 2007 9:15 am

No.
Jordan Sparks, DMD
http://www.opendental.com

Post Reply