For connecting to the MySQL server you need to use MySQL client program. It needs to be provided parameters such as the hostname, username, password etc. to connect to the MySQL Server; if no parameters are specified the default values are assumed. Any of the connection parameters can be specified to override the default values.
Connecting to a local server specifying username and password
# mysql --user=username --password=mypassword databasename; # mysql -u username -pmypassword databasename;
It is important to have passwords for all MySQL user accounts for securing the database. If anyone knows the username of an account with no password then he can successfully connect to the database server.
To assign or change a password for an existing account
mysql> SET PASSWORD FOR 'newuser'@'localhost' = PASSWORD('mypass');
NOTE: Only users such as root that have update access to the mysql database can change the password for other users.
The DROP USER statement is used to delete MySQL accounts and their privileges.
DROP USER 'accountuser'@'localhost';
If you wish to delete multiple user accounts then you can enter them comma separated as shown below:
DROP USER 'accountuser1'@'localhost', DROP USER 'accountuser2'@'localhost';
In Magento Vanilla installation the products are sorted based on “Position” on the product listing page by default. You have the provision to configure the default sorting parameter from Magento admin. In Magento Vanilla installation admin the options available are – “Best Value”, “Name” and “Price”. “Best Value” sorting is actually sorting by position.
“name” and “price” are catalog attributes but “position” is not.
If in case you need to remove sorting by position then you will have to override the Catalog module model but if just you need to change the text then you can do it with the help of locale files.
MySQL user names can be up to 16 characters long.
Here are the queries for creating user accounts in MySQL:
Create user with no password
mysql> CREATE USER 'newuser'@'localhost';
Create user with password test123
mysql> CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'test123';
In Magento you can change the default sorting attribute for product listing page from Magento admin.
To set the sorting attribute login to Magento admin and follow the following steps:
1. Go to Admin >> System >> Configuration >> Catalog
2. Expand the “Frontend” Section
3. Make selection from the “Product Listing Sort by” dropdown
4. Click the “Save Config” button.
In web pages which take input/feedback from the customers it’s a good idea to limit the type and size of data that can be entered so that spam can be avoided.
Let see how we can limit the number of characters that can be entered in a text box.
In order to promote certain products, you may want to place them at the top in the category product listing page. Lets see how to set/change the position of the products from Magento admin.
To set/change the position of the products proceed as below:
1. Login Magento admin and follow the path Admin >> Catalog >> Manage Categories.
2. Click on a category in the category tree to display the category related information.
Solr admin interface provides information about the solr and its running environment, provides the power to manage cores, view the logs etc. It is open to public by default hence a security risk, lets see how we can password protect the solr admin.
The steps mentioned have been tried in a hosting environment which has the following software installed.
If you open the comments.php template file and look at the source code you will find that “wp_list_comments” function is used to display the comments listing. To change the “Reply” text your can pass “reply_text” parameter to “wp_list_comments” function.
Similarly to customize the comments listing frontend design you can pass a callback function as parameter to “wp_list_comments” function.