Showing posts with label XAMPP. Show all posts
Showing posts with label XAMPP. Show all posts

XAMPP: MySQL said: Cannot connect: invalid settings ?

Everybody should be careful when dealing with the 'users' & 'privileges', if you're using PhpMyadmin. I had pretty horrendous experience with this.

To be honest, I was removing users & mistakenly removed the root user. Then, I couldn't even load the PhpmyAdmin at http://localhost/phpmyadmin. When I tried, I had the following error.This means that, I don't have any access to mysql server.

MySQL said:

Cannot connect: invalid settings.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

After searching for solutions for a little bit of time. I'd found the following solution. I write this blog post , so that it'll be helpful for somebody with the same problem.

Step 01.

First, stop the MySQL service using XAMPP Control Panel.


Step 02

Then, Run Command Prompt & go to the 'mysql' installation directory. In my case, It's C:/xampp/mysql.

cd C:/xampp/mysql

Step 03

Then, locate 'resetroot.bat' file and to edit it with notepad, run the following command in the command prompt.


notepad resetroot.bat

Step 04

Find 'bin\mysqld.exe' in the .bat file & in the same line locate a text simliar to '--no-defaults'. Add the following text after leaving a space. Save the file.


–datadir=c:/xampp/mysql/data

Step 05

Now, run resetroot.bat using Command Prompt. Then, Start MySQL service using XAMPP Control Panel.

That's it. You can reach PhpmyAdmin. Thank You.

Install MySQL Workbench with lampp Server in Linux

I've always been a great admirer of MySQL query browser & MySQL administrator tools provided by MySQL official website. But, currently they have limited the development of multiple GUI tools and instead focused on developing the MySQL workbench.

I'm a fan of  'Navicat Premium' in windows application because it serves multiple administration tasks as well as SQL Editing , Development, Designing for both Microsoft SQL & MySQL.



But, recently as my  love of Linux grew than I expected & I had to find new GUI tool specifically for MySQL in Linux. So, this blog post is about installing MySQL workbench the one I suggest everyone should try at least once. (I Used to hang on with 'Emma')

First, let me get this straight. This blog post was intended to be for people who currently do have lampp server installed in their Linux Operating System. (as I used to be one of them)

First, Download Libzip by using the links given below.




Then, Download libmysqlClient by using the links given below.




Then, Press Ctrl+ T & start your Terminal. Type the following Command. 

$ sudo apt-get install libzip1 python-paramiko python-pysqlite2 libctemplate0 libgtkmm-2.4-1c2a libmysqlclient16

Now, you can download MySQL Workbench from the official Download Page. If you're lazy enough not to find it here it is. Download .deb & type the following command in order to install it inside your Linux System.

sudo dpkg -i mysql-workbench-gpl-X.X.XX-XubuXXXX-XXXX.deb 

Hope, it worked. Thank You Enjoy MySQL Workbench.


Installing Joomla in Localhost ?

First, I hope you've heard something about CMS ( Content Management Systems). If not , I prefer you better learn about the importance of having CMS & what are the choices that somebody can make when pursuing a proper one or else, you're in the right place to know easy steps to install Joomla in localhost, one of the most popular CMS available.


Well, installing anything in Linux based Operating System (Ubuntu in my case) is somewhat tricky & often frustrating, yet challenging. So, Joomla is no exception. For those, who're having Windows, Most of the descriptions here won't make sense to you.

Anyway for others, Let's Begin. 

1. First, Download & install XAMPP in Linux Operating System, which is explained here alongside other related articles.

2. When you're done with XAMPP. Go to Joomla Download Page & get a zip of necessary Version of Joomla.

3. Press Ctr l+alt+T & start your terminal. Type Following Commands.

$ sudo cp /Download Location/Joomla_X.X.XX-Stable-Full_Package.zip /opt/lampp/htdocs/


Move zip to 'htdocs' directory. 'htdocs' is where you must place your files, in order to run them with local server.

Then, create a Directory to keep your Joomla Files & type 'nautilus'.

$ mkdir myJoomla

$ sudo nautilus

6. Go to 'htdocs' & Extract, previously copied Joomla Joomla_x.x.xx-Stable-Full_Package.zip file in to the created Directory. Use Archive Manager.


7. Launch a Separate terminal & Type following commands.

$ sudo find /opt/lampp/htdocs/myJoomla/ -type d -exec chmod 755 {} \;

$ sudo find /opt/lampp/htdocs/myJoomla/ -type f -exec chmod 644 {} \;
$ sudo chown -R root:root /opt/lampp/htdocs/myJoomla/
 

Set, Files Permission to 644 & directory permissions to 755 inside your Joomla installation directory.

8. Then, type http://localhost/myJoomla/ in the Browser address bar & press Enter.

9. Now, you've come to the crucial point where, you've to install Joomla like any other software, using your browser, & launch with your test site.

      9.1 First, Pick a language.



   
      9.2 Then, click next and move to the next step. In the next Page, you'll be seeing a list of settings under 'Pre - Installation Check' & look for configuration.php writable. If it's No, then you've to create configuration.php manually.



                  To do that, press Ctrl+alt+T & take a terminal window, move into the Joomla directory where the action is & type the following command.

$ sudo gedit configuration.php

                  save & close the file & type following in the terminal. Press 'Check Again' & Move to the next step.

$ sudo chmod 777 configuration.php 


       9.3  Accept the license agreement & move to the 'Database Configuration' Step. You've to admit that, in order to proceed from this, you've to create User name, Password, Database to serve Joomla Purposes using http://localhost/phpmyadmin. If you're done with it, provide those details into the form & click 'next'.


     9.4 It's recommended to leave the next which is 'FTP Configuration' blank. So, that you can enter your user name & password whenever you transfer any content. Click Next.

      9.5 'Main Configuration' is crucial as you've to enter Administrator Details like User name, Password & Email. If you're new to Joomla You can 'Install Sample Data'. So, you'll be seeing an example site at the beginning of your first Joomla experience.

      9.6 So, that's it. When you hit next after step 9.5 you'll be seeing a message to delete installation directory for security reasons. You can either delete it by clicking the button provided (Which more often won't work) or  go to the Joomla directory & find installation directory & manually delete.

10 . Now, Enter http://localhost/myJoomla/administrator/ into the address bar & proceed.

Thank You have fun with Joomla.

LAMPP Server Problem Fixed ?

What can I say ? It's done at last. Well, I was having a problem with using 'phpmyadmin' with lampp. Previously, I'd my blog-post with instructions to install xampp in Linux.

But, with those steps, I still had this problem when requesting the URL: http://localhost/phpmyadmin/ . 



So, here are the steps to solve this little problem.


Step 01: 

Get the terminal & type the following command to stop the running instance of your local server.

$ sudo /opt/lampp/lampp stop

Step 02:

Type the following command & go to editing mode of httpd-xampp.conf file. Make sure that, you've got the Administrative Privileges in order to do so.

$ sudo vi /opt/lampp/etc/extra/httpd-xampp.conf 


Step 03:

Slide down file & locate the following set of code.

#
# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
        Order deny,allow
        Deny from all
        Allow from ::1 127.0.0.0/8 \
                fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \
                fe80::/10 169.254.0.0/16

        ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>


You've to edit it & it'll be seen like this.

#
# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
        Order deny,allow
        Allow from all
        Allow from ::1 127.0.0.0/8 \
                fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \
                fe80::/10 169.254.0.0/16

        ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>


Step 04:

Find the following code segment inside the file.

# since XAMPP 1.4.3
<Directory "/opt/lampp/phpmyadmin">
    AllowOverride AuthConfig Limit
    Order allow,deny
    Allow from all
</Directory>


Edit, until it looks like this.

# since XAMPP 1.4.3
<Directory "/opt/lampp/phpmyadmin">
    AllowOverride AuthConfig Limit
    Order allow,deny
    Allow from all
    Require all granted
</Directory>


Step 05:

Now, you're almost done. Save your modifications & exit the editor & Run the following command in order to restart your local server.


$ sudo /opt/lampp/lampp restart


Thank You!

Install XAMPP in Ubuntu Linux ?

Hi!

If you need to install xampp in Ubuntu linux, here's a quick guide of how to do that. It's in steps ! So, it'll be easy to go through the article as usual in my blog.


1. First go through this link and download xampp for Linux.

2 . Now, you'll be having a file named like xampp-linux-y.y.yy.tar

3. Now, get your terminal.


     Type sudo nautilus & hit Enter




4. Now, File Manager window will be opened & you've to go to your root directory & find a directory opt & get inside it.



5. Then, take your xampp-linux-y.y.yy.tar & extract it inside /opt.


You'll see a directory named lampp.

6. Now, take out terminal again & type cd /opt .


7. Then, Type sudo chmod 777 lampp. (Give Read,write & execute privileges to all users).


8. Tpe sudo naulius & take back file manager window & go to /opt/lampp/htdocs.


 Make a directory to store your php files. (Name it the way you want) Ex: MYPHP.

9.  Then, take terminal back & type sudo /opt/lampp/lampp start. 


10. Start Web Browser & type http://localhost in the addressbar.


11. Then, Select English & Type http://localhost/MYPHP to go to your php file directory.




Enjoy! PHP with XAMPP.