
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.sabayonlinux.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.sabayonlinux.org/index.php?title=HOWTO:_Setup_MySQL_and_JDBC_for_java_to_database_programming&amp;feed=atom&amp;action=history</id>
		<title>HOWTO: Setup MySQL and JDBC for java to database programming - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.sabayonlinux.org/index.php?title=HOWTO:_Setup_MySQL_and_JDBC_for_java_to_database_programming&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://wiki.sabayonlinux.org/index.php?title=HOWTO:_Setup_MySQL_and_JDBC_for_java_to_database_programming&amp;action=history"/>
		<updated>2013-05-21T07:00:50Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.4</generator>

	<entry>
		<id>http://wiki.sabayonlinux.org/index.php?title=HOWTO:_Setup_MySQL_and_JDBC_for_java_to_database_programming&amp;diff=8367&amp;oldid=prev</id>
		<title>Darksurf: clean up</title>
		<link rel="alternate" type="text/html" href="http://wiki.sabayonlinux.org/index.php?title=HOWTO:_Setup_MySQL_and_JDBC_for_java_to_database_programming&amp;diff=8367&amp;oldid=prev"/>
				<updated>2010-04-14T19:14:48Z</updated>
		
		<summary type="html">&lt;p&gt;clean up&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Remember to do all this as root! Meaning use sudo before every command or sudo su once before starting this guide. &lt;br /&gt;
&lt;br /&gt;
1)&lt;br /&gt;
First install mysql using the package manager of your choice.&lt;br /&gt;
{{Console|&lt;br /&gt;
&amp;lt;pre class=&amp;quot;clear&amp;quot;&amp;gt;&lt;br /&gt;
equo install mysql jdbc-mysql dev-java/sun-jdk&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
Now that we have the packages installed, the JDK needs mysql-jdbc.jar in the extensions folder to recoginize its installation so&lt;br /&gt;
{{Console|&lt;br /&gt;
&amp;lt;pre class=&amp;quot;clear&amp;quot;&amp;gt;&lt;br /&gt;
cp /usr/share/jdbc-mysql/lib/mysql-jdbc.jar /opt/sun-jdk-1.6.0.17/jre/lib/ext/&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
2)&lt;br /&gt;
Then prepare the mysql database for use and start the mysql process. Run the following commands to prepare the database.&lt;br /&gt;
{{Console|&lt;br /&gt;
&amp;lt;pre class=&amp;quot;clear&amp;quot;&amp;gt;&lt;br /&gt;
/usr/bin/mysql_install_db; /etc/init.d/mysql start&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
NOTE: some people have reported problems with mysql acting funny when these commands are ran. If you experience issues. Try&lt;br /&gt;
{{Console|&lt;br /&gt;
&amp;lt;pre class=&amp;quot;clear&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysql zap&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
then try step 2 again to see if it works.&lt;br /&gt;
&lt;br /&gt;
3)&lt;br /&gt;
Also prepare root for use by giving the administrator (root) a password using the following command.&lt;br /&gt;
{{Console|&lt;br /&gt;
&amp;lt;pre class=&amp;quot;clear&amp;quot;&amp;gt;&lt;br /&gt;
mysqladmin -u root password 'new-password'&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
4) (optional)&lt;br /&gt;
If you want MySQL to start automatically everytime you bootup or turn on your computer then run&lt;br /&gt;
{{Console|&lt;br /&gt;
&amp;lt;pre class=&amp;quot;clear&amp;quot;&amp;gt;&lt;br /&gt;
rc-update add mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt; }}&lt;br /&gt;
If you don't mind starting the mysql server manually whenever you want to use it run (as root or superuser)&lt;br /&gt;
{{Console|&lt;br /&gt;
&amp;lt;pre class=&amp;quot;clear&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/mysql start&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
and login using a terminal like usual (not in root terminal)&lt;br /&gt;
{{Console|&lt;br /&gt;
&amp;lt;pre class=&amp;quot;clear&amp;quot;&amp;gt;&lt;br /&gt;
mysql -u root -p&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
Now download a java IDE to develop your java application. One preference is Netbeans. Its free and created by the people who developed java in the first place. I believe this is the best choice. You are welcome to use whatever you prefer, but this how to will use netbeans-6.8 ;)&lt;br /&gt;
&lt;br /&gt;
go to  [http://netbeans.org/] and download the latest version of netbeans. Make sure you pick the java version, or the ALL version.&lt;br /&gt;
Netbeans is an IDE for more than Java, but an IDE for Java SE, Java FX, (basically all of java), C++, PHP, and Ruby.&lt;br /&gt;
&lt;br /&gt;
now right click the netbeans.sh file you downloaded and click properties, then click Permissions, and check box &amp;quot;is executable&amp;quot; &lt;br /&gt;
OR if you are using something other than KDE, type in root terminal&lt;br /&gt;
{{Console|&lt;br /&gt;
&amp;lt;pre class=&amp;quot;clear&amp;quot;&amp;gt;&lt;br /&gt;
chmod +X /Downloads/netbeans-6.8-ml-java-linux.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
Now that it is executable in a user terminal (non-root as root cannot access X sometimes) type&lt;br /&gt;
{{Console|&lt;br /&gt;
&amp;lt;pre class=&amp;quot;clear&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/Downloads/&lt;br /&gt;
sudo ./netbeans-6.8-ml-java-linux.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
It should start an installation window. click customize and uncheck any checkboxes under &amp;quot;Runtimes&amp;quot;.&lt;br /&gt;
You really don't need these unless you know what you are using them for.&lt;br /&gt;
Select OK, agree to license, and now you should see &amp;quot;Netbeans IDE installation folder&amp;quot;&lt;br /&gt;
It will want to install in &amp;quot;/usr/local/netbeans-6.8&amp;quot;&lt;br /&gt;
For simple reasons its not in the package manager we want to seperate it from the rest of the system&lt;br /&gt;
so we can have a clean uninstall when you wish to remove it later or upgrade.&lt;br /&gt;
So change that to &amp;quot;/opt/netbeans-6.8&amp;quot; and click install.&lt;br /&gt;
&lt;br /&gt;
If you would like some code to look at to get a feel or an idea on how to write some java jdbc code. I would be happy to&lt;br /&gt;
send you some code I wrote while in my database class in college. Just email me [mailto:piroisl33t@yahoo.com]&lt;br /&gt;
&lt;br /&gt;
Now you have netbeans, jdbc, and mysql installed! Happy coding!&lt;/div&gt;</summary>
		<author><name>Darksurf</name></author>	</entry>

	</feed>