Skip to main content

Posts

MySQL shutdown unexpectedly and stating issue

🛠 How to Restore MySQL Database from Backup in XAMPP If you're trying to restore your MySQL databases from a backup using XAMPP, follow these steps carefully: 📁 Step 1: Rename the Existing data Folder First, you’ll want to rename the current MySQL data directory to keep a backup of it: bas rename mysql/data to mysql/data_old Or manually: Navigate to C:\xampp\mysql . Rename the data folder to data_old . 📂 Step 2: Copy the Backup Folder Now, copy your backup folder and rename it to data : mysql/backup to mysql/data Manually: Copy the entire backup folder located in C:\xampp\mysql . Paste it inside the same mysql directory. Rename the copied folder to data . 📄 Step 3: Copy Database Folders and MySQL System Folder Next, copy your actual databases and the mysql system folder from the old data directory to the new one: Go to C:\xampp\mysql\data_old . Copy all your custom database folders (except performance_schema , phpmyadmin , etc.). Also copy the my...

Update your Unique Primary Id using LAST_INSERT_ID()

 A   trick   for using   LAST_INSERT_ID()   to generate sequences in MySQL. Quoting from the Manual: Create a table to hold the sequence counter and initialize it: mysql> CREATE TABLE sequence (id INT NOT NULL); mysql> INSERT INTO sequence VALUES (0); Use the table to generate sequence numbers like this: mysql> UPDATE sequence SET id=LAST_INSERT_ID(id+1); mysql> SELECT LAST_INSERT_ID(); This trick calls for trouble. Contention A customer was using this trick to generate unique session IDs for his JBoss sessions. These IDs would eventually be written back to the database in the form of log events. Business go well, and one day the customer adds three new JBoss servers (doubling the amount of webapps). All of a sudden, nothing works quite as it used to. All kinds of queries take long seconds to complete; load average becomes very high. A short investigation reveals that a very slight load is enough to make for an accumulation of sequence-UPDAT...

How to extend JQuery bass class in the VtigerCRM

  [Vtigercrm-developers] jQuery.Class and extend() Prasad   prasad at vtiger.com Wed Jun 25 03:41:25 GMT 2014 Previous message:  [Vtigercrm-developers] jQuery.Class and extend() Next message:  [Vtigercrm-developers] jQuery.Class and extend() Messages sorted by:   [ date ]   [ thread ]   [ subject ]   [ author ] Alan, registerEvents is the main function that gets invoked on the client-side javascript controller. Either new / extend works. With extending the base list view it gets the other function definitions that can be invoked at sometime later. WorldClock v1 example doesn't follow the same UI conventions as its parent and hence does not invoke the parent method. Have a look at few standard modules like (Contacts < http://trac.vtiger.com/svn/vtiger/vtigercrm/branches/6.0.0/layouts/vlayout/modules/Contacts/resources/Detail.js >, Rss < http://trac.vtiger.com/svn/vtiger/vtigercrm/branches/6.1.0/layouts/vlayout/modules/Rss/resources/Lis...

How to create custom module in the VTiger CRM ?

Remember the following steps.these are the following    Open your Windows Command Prompt Go to your project Dir. wamp or xampp where your project place  www/vtiger/vtlib/tools run php -f console.php 1) Create New Module  2)Create new Layout  3)Create new language pack 4)Create new test language pack  5)Import modules  6)update module 7)Remove Module Then Enter you choice 

How to run a PHP program from command prompt on a Windows Machine?

  his way I'm able to run the PHP programs finely but I want to run the same program from   Windows Command Prompt For it I done following steps : Went to  Advanced System Settings  (Control Panel\System and Security\System\Advanced System Settings) Then clicked on  Environment Variables Then selected the variable  Path Then clicked  Edit...  button Then after the ending semicolon of existing string I added the string  "C:\xampp\php"  by adding a  blank space  after the semicolon. Skip to Step 4 by  left clicking  the  Windows Start Button  and then immediately type  system env , windows search will suggest  Edit the system environment variables , Click this and and go to step 4. Right Click Windows Start  Button, Select  System Click on  System Information Click on  Advanced System Settings Click on  Environment Variables Select  PATH  under  System Variable...

Debugging VTiger CRM

   default Debugging error in the Vtiger. Database Debugging 50% of all problems are a result of corrupt or wrong database queries. There is a fast an easy way to recognize this and get a detailed output, where you need to search for the issue. Also this information helps support persons of module providers to get a more detailed error description. Open the file  include/database/PearDatabase.php Search the line  $adb->connect();  (At the end of the file) You have 2 options in this situation: Add the line: $adb->setDebug(true); This line will output EVERY Query sent to the database. The last one will be the corrupt one and you get an error description, when an error happens. Sometimes it will be helpful to get all queries and also see queries, before the exception Add the line: $adb->setDieOnError(true); This line will output only a detailed error report if a query generates an database error. This works better for module support, because you don’t need...

How to convert MySQL MySQLi into MySQLi database

The first thing we need to look at is that MySQL is a resource and MySQLi is an object. To migrate our code, we really do not need to understand the technical difference, however we must understand that they are different. The first thing we usually do with MySQL is to connect to and select a database, so let's take a look at mysql_connect and mysql_select_db. $connection = mysql_connect( 'host', 'username', 'password', new_link,flags); $database = mysql_select_db( 'database', $link); $connection is a MySQL link identifier to the resource and $database is just a boolean variable that will contain true on success or false on failure. In most situations your host will be localhost and you will only have supplied your username and password. mysqli_connect in PHP Now let's take a look at its counter-part in MySQLi, mysqli_connect. $connection = mysqli_connect( 'host', 'username', 'password', 'database', 'port',...

password login instead of a key pair in aws ec2 instance

How do I enable a password login instead of a key pair when logging into my EC2 instance using SSH? Last updated: 2019-09-17 I want to log in to my Amazon Elastic Compute Cloud (Amazon EC2) instance by SSH with a password rather than by using a key pair file (.pem). How do I do that?  Short Description To enable a password authentication, you create a password, update the /etc/ssh/sshd_config file, and then restart the SSH service. The following procedure is tested on Amazon Linux, RHEL, SUSE, and Ubuntu. Note:  Using a password-based login rather than key pair authentication has security implications. Therefore, password-based login isn't recommended. Also, it's a best practice to minimize the source IP addresses of the security group rules associated with your instance to prevent an SSH attack. Resolution 1.    From an SSH client, log in to your EC2 instance. Use one of the following user names: For Amazon Linux, the user name is...