# installing mysql



## freaks (Mar 1, 2010)

hello,
i made my first install of freebsd and i have successfully installed apache and php5 but i have a problem with mysql
this is the report

```
cd /usr/ports/databases/mysql55-server
surge# make install
===>  mysql-server-5.5.1 cannot install: MySQL versions mismatch: mysql50-client is installed and wanted version is mysql55-client.
*** Error code 1

Stop in /usr/ports/databases/mysql55-server.
```
how can i resolve this ?
thanks


----------



## sniper007 (Mar 1, 2010)

*mysql50-client is installed and wanted version is mysql55-client*

First deinstall/upgrade mysql50-client to mysql55-client then install mysql55-server


----------



## freaks (Mar 1, 2010)

sniper007 said:
			
		

> *mysql50-client is installed and wanted version is mysql55-client*
> 
> First deinstall/upgrade mysql50-client to mysql55-client then install mysql55-server



ok what is the command ?

```
pkg_delete -f mysql-client-5.0
pkg_delete: no such package 'mysql-client-5.0' installed
```
thks


----------



## DutchDaemon (Mar 1, 2010)

Either use the exact package version from [cmd=]pkg_info -IX mysql-client[/cmd] or use a wildcard, like [cmd=]pkg_delete mysql-client\*[/cmd].


----------



## sniper007 (Mar 1, 2010)

or cd to proper port location and strike *make deinstall * if you installed from ports


----------



## DutchDaemon (Mar 1, 2010)

[cmd=]make deinstall[/cmd] should only be used if one is certain that the version in ports hasn't changed since it was installed. The newer version's pkg-plist file may not match what was actually installed. This problem does not occur with [cmd=]pkg_delete[/cmd] which uses the installed port's data.


----------



## gilinko (Mar 2, 2010)

freaks said:
			
		

> ok what is the command ?
> 
> ```
> pkg_delete -f mysql-client-5.0
> ...



The package is named *mysql50-client* not *mysql-client-5.0*(as stated in your first error message). So do it with the correct name and it will work, ie:

```
pkg_delete -f mysql50-client
```

And if remember correctly you will have to rebuild ALL ports that depend on the mysql client port as there are some large changes from the 5.0/5.1 versions. Particularly how the username / password interface works.


----------



## DutchDaemon (Mar 2, 2010)

```
$ pkg_info -IX mysql-client
mysql-client-5.0.90 Multithreaded SQL database (client)
```

So a pkg_delete on mysql-client-5.0\* should work just fine..


----------



## sniper007 (Mar 2, 2010)

pkg_delete mysql-client-5.0* 

wouldn't works (just curious) ?


----------



## DutchDaemon (Mar 2, 2010)

Not every shell plays nice with the unescaped '*'.


----------



## SirDice (Mar 4, 2010)

Use the -x option:

`# pkg_delete -x mysql-client`


----------



## phoenix (Mar 4, 2010)

DutchDaemon said:
			
		

> Either use the exact package version from [cmd=]pkg_info -IX mysql-client[/cmd] or use a wildcard, like [cmd=]pkg_delete mysql-client\*[/cmd].



`# pkg_delete -xi mysql`

-x tells pkg_delete to do a wildcard search, -i tells it to ask for confirmation before deleting any packages.


----------



## phoenix (Mar 4, 2010)

gilinko said:
			
		

> The package is named *mysql50-client* not *mysql-client-5.0*(as stated in your first error message). So do it with the correct name and it will work, ie:
> 
> ```
> pkg_delete -f mysql50-client
> ```



No, the package is called mysql-client-<version>.  The port directory is called mysql50-client.  Big difference.  

And you should never use -f without -i on pkg_delete, or else nasty things can happen without your knowing.


----------

