Installing Mysql
I am really new to this so im hoping this is the place to get some help! I need to install mysql on my server. Previous servers I had already had everything set up for me…
81 Replies
Also I'd recommend Googling for a general guide on how to manage that distribution; that will answer this and many other questions.
Specifically, chapter 3:
To answer your question, you probably want to run:
aptitude install mysql-server
1. If you're on Windows, download PuTTY or something like that.
2. Run PuTTY.
3. Type in your linode's IP address (which you can find in the "Network" tab of Linode Manager) and hit Enter.
4. That'll drop you into your linode's shell (terminal).
5. Log in as "root" using the password you set up when you deployed your Linux distribution.
6. Now you can start typing away other commands.
Or alternatively, you can find a web-based shell in the "Console" tab of Linode Manager. It's called LISH. The web-based shell tends to break some screen layouts, though.
Quick Apache + PHP + MySQL setup:
apt-get update
apt-get upgrade
apt-get install apache2 php5 php5-mysql mysql-server mysql-client
(You can replace apt-get with aptitude)
In your management console (on the Linode site), click the Networking tab. You'll then see the external IP address of your node. To get a terminal prompt, use a program like Putty
Unfortunately I'm not sure what the correct username and password are for a default Ubuntu install on Linode.
As far as interface, you can use the basic client programsphpMyAdmin
"mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
"
Uptime: 2179002 Threads: 1 Questions: 6096795 Slow queries: 214
Opens: 4611 Flush tables: 1 Open tables: 64 Queries per second avg: 2.798
The way I'm reading that is that the root account has a password but it wasn't supplied by the user, which is why the error says, "(Using password: NO)"
Christina, try using the -p option and it should ask you for a password. If it doesn't post your command and options, please.
"root@li65-162:~# /etc/init.d/mysql start
- Starting MySQL database server mysqld
…done."
Im not really sure what to google to get more info… you guys have been so awesome in helping me out thank you!!! I cant wait to read up and learn more…
Right now I have backup files ( that the old developer gave to me from the old server) they are .sql how would I go about getting the back up files into my new mysql?
I just dont want to do something that im not suppose to be
1. apt-get install phpmyadmin
2. Point your browser at
3. Log in as root + MySQL root password (not your SSH root password, though they may be the same)
4. Create a databse
5. Go to "privileges", add a user, give the user access to the database
6. Log out of phpmyadmin and try to log back in as newly created user
7. Select the database
8. Go to "import" and just upload the .sql file!
getting an error
I can't connect to it from 3 different locations.
Have you installed Apache, Lighttpd, or ngix?
What's the error message you get when you try to access your site with a web browser?
Firefox can't establish a connection to the server at 97.107.135.162.
Im kind of confused ( and im sorry) about when u say install… do i upload the files to my server? do i write a command in the terminal? I thought I had mysql running but i guess not.. thanks for being patient with me
@christina:
root@li65-162:~# /etc/init.d/mysql start
- Starting MySQL database server mysqld
…done."
Mysql is installed and running – you just need a web server if you want to upload data via a browser & phpmyadmin.
Have you followed hybinet's suggestions, above ?
Cheers.
Easy way
1. apt-get install phpmyadmin
2. Point your browser at
3. Log in as root + MySQL root password (not your SSH root password, though they may be the same)
4. Create a databse
5. Go to "privileges", add a user, give the user access to the database
6. Log out of phpmyadmin and try to log back in as newly created user
7. Select the database
8. Go to "import" and just upload the .sql file!
When i go to
The requested URL /phpmyadmin was not found on this server.
Apache/2.2.11 (Ubuntu) Server at 97.107.135.162 Port 80
ls -l /var/www
Did apititude offer to configure Apache for you, when you installed it ? Nonetheless, restart apache just in case you installed them in an odd order:````
/etc/init.d/apache2 restart
Edit: Actually, I'm guessing that you probably didn't let Aptitude auto configure phpmyadmin. To do it again:````
dpkg-reconfigure phpmyadmin
– and make sure Apache is selected (has a dot in the box -- use the space bar), then press tab to a few times to select the OK button, then press enter.
this is what i get when i type that command
root@li65-162:~# ls -l /var/www
total 4
-rw-r--r-- 1 root root 45 May 28 21:52 index.html
ln -s /usr/share/phpmyadmin/index.php /var/www/phpmyadmin
Code:
dpkg-reconfigure phpmyadmin
– and make sure Apache is selected (has a dot in the box -- use the space bar), then press tab to a few times to select the OK button, then press enter.
Im working on a mac via terminal… im not sure what you mean when u say i should be able to select things
more /etc/apache2/sites-available/default
<directory var="" www="">.
Options Indexes FollowSymLinks MultiViews
.
.</directory>
DocumentRoot /var/www
AllowOverride None
AllowOverride None
Order allow,deny
allow from all
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ErrorLog /var/log/apache2/error.log
Possible values include: debug, info, notice, warn, error, crit,
alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
Alias /doc/ "/usr/share/doc/"
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
When you run the following, are you asked any questions ?
dpkg-reconfigure -plow phpmyadmin
Package `phpmyadmin' is not installed and no info is available.
Use dpkg –info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
/usr/sbin/dpkg-reconfigure: phpmyadmin is not installed
its saying phpmyadmin is not installed… When I log on to my server with an ftp I only see 2 folders 1) .aptitude 2).debtags
should I be downloading and uploading things to my server to get mysql to work?
@christina:
this is what confuses me
Package `phpmyadmin' is not installed and no info is available.
Use dpkg –info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
/usr/sbin/dpkg-reconfigure: phpmyadmin is not installed
its saying phpmyadmin is not installed… When I log on to my server with an ftp I only see 2 folders 1) .aptitude 2).debtags
should I be downloading and uploading things to my server to get mysql to work?
Mysql is installed, see above. Packages aren't normally installed into your home directory, so don't worry about the lack of folders present (maybe grab a good book on *nix when you have time
Did you run through hybinet's suggestions, above ? (If so, you should have had phpymadmin installed). Anyway, for whatever reason it's not present, so go ahead and install it:
apt-get update && apt-get install phpmyadmin
Hit
Hit
Hit
Hit
Hit
Hit
Hit
Hit
Hit
Hit
Hit
Hit
Reading package lists… Done
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Couldn't find package phpmyadmin
root@li65-162:~#
I am def going to read up on this stuff but my problem now is I have a server that just shit down at 5pm. I need to put the site back up asap… thats why i was posting and trying to figure it out. I want to figure it out but is anyone interested in spending some time on this with me or alone and I will be more then happy to compensate you…
You need to enable the Universe repository for ubuntu:````
nano /etc/apt/sources.list
Use the down arrow to scroll to the bottom, and find the line that looks something like:
deb http://us.archive.ubuntu.com/ubuntu/ jaunty main
Add the word "universe" to the end, so that it becomes:
deb http://us.archive.ubuntu.com/ubuntu/ jaunty main universe
````
1. Press CTRL-o (the letter o) and enter, to write the file.
2. Press CTRL-x to exit.
3. Now re-run the apt-get update && apt-get install phpmyadmin command from above.
when you code I take that and the paste it in terminal… is that correct? I just get alittle confused when u say scroll down and change stuff bc i have very few options with terminal…
also when i put in the first line of code it says this
root@li65-162:~# nano/etc/apt/sources.list
-bash: nano/etc/apt/sources.list: No such file or directory
@christina:
nano/etc/apt/sources.list
-bash: nano/etc/apt/sources.list: No such file or directory You need a space between "nano" and /etc/apt/sources.list. To paraphrase, "using the editor called "nano", open the file called /etc/apt/sources.list". Without the space, it's just one long, non-existant command.
Within the terminal, you should be able to scroll up and down within the file (when editing with nano) using the arrow keys on your macbook.
![](
main & restricted repositories
deb
deb-src
deb
deb-src
universe repositories
deb http://us.archive.ubuntu.com/ubuntu/ jaunty universe
deb-src http://us.archive.ubuntu.com/ubuntu/ jaunty universe
deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ jaunty-updates universe
deb http://security.ubuntu.com/ubuntu jaunty-security universe
deb-src http://security.ubuntu.com/ubuntu jaunty-security universe
should I change the top one?
@christina:
(first line after ## universe repositories)
deb
http://us.archive.ubuntu.com/ubuntu/ jaunty universe(second to last line)
deb
http://security.ubuntu.com/ubuntu jaunty-security universe
Then
apt-get update
apt-get install phpmyadmin
Anyway, when phpmyadmin is up and running, you can follow my instructions in the previous page.
The upload your website files to /var/www
(Edit the file containing database settings, if necessary)
Good luck
An .htaccess file at the very least (and preferably install an SSL cert as well).
does it look like I did everything correctly?
@christina:
WOW that was pretty cool!!!! what was that file?
http://97.107.135.162/phpmyadmin does it look like I did everything correctly?
That's the raw php. For some reason, your php processor's not doing what it should. I'd restart Apache (though apt should have done this anyway):
/etc/init.d/apache2 restart
apt-get install php5
/etc/init.d/apache2 restart
GET
Odd.
nano /var/www/index.php
Put the following line in it, and save.
Point your browser at
Do you see the text you just entered, or do you see a lot of other stuff in colorful tables?
(If the previous test succeeds and you see colorful tables, you must not do this.)
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .phps
You can put it anywhere you want, but the best location is probably just before the ScriptAlias stuff.
Now restart apache…
/etc/init.d/apache2 restart
Cross your fingers & try again.
-bash: /etc/apache2/sites-available/default: Permission denied
This is still very strange. Last time I checked, Ubuntu could install and configure Apache2 and mod_php all at the same time and make the whole thing ready to go.
I gotta go now, but let's try one last thing before someone else can suggest better.
Reinstall the whole LAMP stack!
apt-get purge apache2
rm -rf /etc/apache2
apt-get install --reinstall apache2 libapache2-mod-php5 php5 php5-mysql mysql-server mysql-client phpmyadmin
the script did not pass –debconf-ok to ucf. The maintainer
script should be fixed to not stop debconf before calling ucf,
and pass it this parameter. For now, ucf will revert to using
old-style, non-debconf prompting. Ugh!
Please inform the package maintainer about this problem.
Replacing config file /etc/phpmyadmin/config-db.php with new version
dbconfig-common: flushing administrative password
You could also try to update your entire distro first:
apt-get update && apt-get dist-upgrade
Followed by hybinet's suggestion to reinstall the entire LAMP stack.
Then let's stop trying to troubleshoot configuration files by hand and let's install a decent control panel.
Shut down your linode, shrink the disk image with which you've been working, and create a new Ubuntu 9.04 image. Yes, we're starting fresh.
Choose Ubuntu 9.04.
Skip the first two pages, because Ubuntu is already installed for you. Start with page 3, number 7.
Just copy & paste from the tutorial, step by step, changing a few numbers as necessary (such as IP addresses)
Whenever it says vi something, replace the vi with nano. Vi is a text editor which isn't particularly n00b-friendly.
See if you have better luck with a more detailed tutorial like this.
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
93:a6:62:45:bf:e1:ec:57:6e:19
Please contact your system administrator.
Add correct host key in /Users/newowner/.ssh/known_hosts to get rid of this message.
Offending key in /Users/newowner/.ssh/known_hosts:9
RSA host key for 97.107.135.162 has changed and you have requested strict checking.
Host key verification failed.
[Process exited - exit code 255]
Just open /Users/newowner/.ssh/known_hosts and either delete all of the lines there (if you haven't used SSH for any other server), or just line 9, if you do want to keep the other entries.
If you haven't yet installed your new image, then it's possible something ill is happening; but don't worry, as it's all about to be wiped anyway.
On your macbook (your new ubuntu image is fine). Just open up the file /Users/newowner/.ssh/known_hosts with your editor of choice.
root@li65-162:~# apt-get install postfix postfix-mysql postfix-doc mysql-client mysql-server courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql openssl courier-maildrop getmail4 rkhunter binutils
Reading package lists… Done
Building dependency tree
Reading state information… Done
postfix is already the newest version.
postfix-mysql is already the newest version.
postfix-doc is already the newest version.
mysql-client is already the newest version.
mysql-server is already the newest version.
E: Couldn't find package courier-authdaemon
How do you edit or comment out… The tutorial asked me to do this
and im not sure how to comment it out… are there special key strokes?
We want MySQL to listen on all interfaces, not just localhost, therefore we edit /etc/mysql/my.cnf and comment out the line bind-address = 127.0.0.1:
vi /etc/mysql/my.cnf
[…]
Instead of skip-networking the default is now to listen only on
localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
[…]
Example:````
Instead of skip-networking the default is now to listen only on
localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
````
Those 3 lines are commented out and the program ignores them when reading the configuration file.
Im also getting alot of erroe saying that packages I want to install cant be installed ex
root@li65-162:~# apt-get install amavisd-new spamassassin clamav clamav-daemon zoo unzip bzip2 arj nomarch lzop cabextract apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip libnet-dns-perl
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package zoo is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package zoo has no installation candidate
am i doing something wrong?
Just for your information, when you're following a tutorial and it tells you to install things and you get an error such as "Can't find package XXX" or "YYY has no install candidate", just remove the XXX or YYY from the command and try again. This usually happens when you don't have all the repositories enabled, or if there are subtle changes between software versions that the author of the tutorial overlooked. Nothing to worry about.