100g of industrial aminoacetic acid, 400ml of n-octanol and 11g of catalyst p-toluenesulfonic acid were added into a three-necked flask, connected with a water separator, condenser tube and stirrer, heated, gradient temperature, and at a certain temperature to make the gallic acid completely dissolved, and then heated up to 105 for the reaction to the end point of the reaction when there is no water generated (the reaction time was 4 hours). Then the reaction product was neutralized, washed, crystallized by low temperature cooling and vacuum filtration, and the crude product of n-octyl aminoacetate with white needle-like crystals was obtained; the crude product of n-octyl aminoacetate was refined, recrystallized and vacuum dried, and 81.2g of finished product of n-octyl aminoacetate was obtained, containing 99.3%, and then n-octyl aminoacetate hydrochloride was obtained by adding hydrochloric acid.